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
If arguments are provided to a recharge model, for example ps.rch.FlexModel(interception=False), and the model is copied or stored and loaded from a pas-file (same thing), the results are not the same. This is because recharge objects are not stored properly. The correct way to do this is to add a to_dict method, which exports the exact same arguments that go into the init of the class, plus the name of the class. This needs to be changed.
To Reproduce
Run example_snow.py.
ml2 = ml.copy()
=> model is different, no snowmodel.
Expected behavior
Return the same model.
Solution
The solution is easy, properly implement a to_dict method for recharge models. PR coming up.
The text was updated successfully, but these errors were encountered:
raoulcollenteur
changed the title
[BUG] copying models with recharge models is wrong
[BUG] copying models with recharge models can go wrong
Jan 26, 2023
Describe the bug
If arguments are provided to a recharge model, for example
ps.rch.FlexModel(interception=False)
, and the model is copied or stored and loaded from a pas-file (same thing), the results are not the same. This is because recharge objects are not stored properly. The correct way to do this is to add a to_dict method, which exports the exact same arguments that go into the init of the class, plus the name of the class. This needs to be changed.To Reproduce
Run example_snow.py.
ml2 = ml.copy()
=> model is different, no snowmodel.
Expected behavior
Return the same model.
Solution
The solution is easy, properly implement a to_dict method for recharge models. PR coming up.
The text was updated successfully, but these errors were encountered: