-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
If we provide a wrong mapping, we don't necessarily return an error, and even worse, we may mutate the wrong variable.
I found this issue when implementing the LeafGeometryModel in XPalm. You can reproduce it using the following mapping instead of the one we have now:
MultiScaleModel(
model=VPalm.LeafGeometryModel(
mtg=p.mtg,
rng=Random.MersenneTwister(p.parameters["vpalm"]["seed"]),
vpalm_parameters=p.parameters["vpalm"]
),
mapped_variables=[
:graph_node_count => "Scene" => :graph_node_count,
:height_internodes => "Internode" => :height,
:radius_internodes => "Internode" => :radius,
:biomass_leaves => "Leaf" => :biomass,
:rank_leaves => "Leaf" => :rank,
],
),For reference, we currently have:
MultiScaleModel(
model=VPalm.LeafGeometryModel(
mtg=p.mtg,
rng=Random.MersenneTwister(p.parameters["vpalm"]["seed"]),
vpalm_parameters=p.parameters["vpalm"]
),
mapped_variables=[
:graph_node_count => "Scene" => :graph_node_count,
:height_internodes => ["Internode" => :height],
:radius_internodes => ["Internode" => :radius],
:biomass_leaves => ["Leaf" => :biomass],
:rank_leaves => ["Leaf" => :rank],
],
),Notice how we wrongly define the mapping for the internodes and leaves, as if we expected a single node out of them. The result is that we get a leaf biomass that is very high, always increasing. This is very bad as we silently change the wrong variable...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working