The structure of the output is very complex at the time, with for each scale a vector with values for each time-step with a vector of the results for each node inside. When we transform it into a DataFrame, it takes as long as making the whole simulation.
Proposition: simplify the output structure with for each scale one vector of nametuple with the timestep, the node, and the values of the variables, e.g.:
Leaf = [
(timestep=1, node = node_8, area=1.0, length=2.0),
(timestep=1, node = node_11, area=1.0, length=2.0),
(timestep=2, node = node_8, area=1.5, length=2.1),
(timestep=2, node = node_11, area=1.8, length=3.0),
]
Plant = [
...
]
This way it would already follow the Tables.jl interface, so no copy would be done when transforming into a DataFrame.
The structure of the output is very complex at the time, with for each scale a vector with values for each time-step with a vector of the results for each node inside. When we transform it into a DataFrame, it takes as long as making the whole simulation.
Proposition: simplify the output structure with for each scale one vector of nametuple with the timestep, the node, and the values of the variables, e.g.:
This way it would already follow the
Tables.jlinterface, so no copy would be done when transforming into a DataFrame.