You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've run into the following scenario: someone gets a model via the m = ModelName.get_model() function. I then remove a component from m via the delete! function. At this point m now can have a number of external parameters that are not used anywhere. Say one of the left-over parameters if called foo. foo was used by the component that I just deleted.
Now I add a new component that also has a parameter foo. Of course when I call set_param!(m, :compName, :foo, 3) it now errors because m already has a parameter called foo.
I'm not sure what the right behavior here would be, and maybe the current one is actually correct....
But here are some alternative options:
delete! on a component could delete stray parameters like foo. That seems a bit drastic, though... Maybe we need a keyword argument also_delete_stray_params that one can use if one wants to get rid of stray parameters?
or is this really a scenario where the replace component functionality should be used?
do we have a function that deletes an external parameter from a model?
Also CCing @FrankErrickson, what he thinks might be useful here.
The text was updated successfully, but these errors were encountered:
I've run into the following scenario: someone gets a model via the
m = ModelName.get_model()
function. I then remove a component fromm
via thedelete!
function. At this pointm
now can have a number of external parameters that are not used anywhere. Say one of the left-over parameters if calledfoo
.foo
was used by the component that I just deleted.Now I add a new component that also has a parameter
foo
. Of course when I callset_param!(m, :compName, :foo, 3)
it now errors becausem
already has a parameter calledfoo
.I'm not sure what the right behavior here would be, and maybe the current one is actually correct....
But here are some alternative options:
delete!
on a component could delete stray parameters likefoo
. That seems a bit drastic, though... Maybe we need a keyword argumentalso_delete_stray_params
that one can use if one wants to get rid of stray parameters?Also CCing @FrankErrickson, what he thinks might be useful here.
The text was updated successfully, but these errors were encountered: