[Python] Array are not allocated correctly in functions #242
Open
Description
#Transpilation from Python to Crop2ML
When an array is defined in a model everything is OK.
For instance
soilConstituentNames : 'Array[str]' = ["Rocks", "OrganicMatter"]
is transformed in
cdef str soilConstituentNames[]
soilConstituentNames=["Rocks", "OrganicMatter"]
But when arrays are defined in functions, the initialisation is missing
thermalCondPar1 : 'Array[float]'= [0.0]*(numNodes + 1)
leads to
cdef float thermalCondPar1[]
Workaround
Declare the arry on two lines
thermalCondPar1 : 'Array[float]'
thermalCondPar1= [0.0]*(numNodes + 1)
Metadata
Assignees
Labels
No labels