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
Describe the bug
When you create a model extension class an attribute which is an argument to class.__init__ and which is not json serializable, the state class will complain when saving the settings.
To Reproduce
Create a model extension with an attribute that is not json serializable and run a simulation.
Additional context
The state class stores the settings and metadata as a json (see here). Part of the settings object is the parameters of the different model parts. These parameters are set here. This param property of BaseModel is constructed by looping over parameters in the signature of class.__init__ and getting the current values of these parametes as a class attribute. If the current value is not json serializable, this will give a problem when the state class tries to store the settings.
Another problem is that this method of storing the model parameters only works if the arguments to __init__ are actually used as class attributes, which need not be the case.
The text was updated successfully, but these errors were encountered:
Describe the bug
When you create a model extension class an attribute which is an argument to
class.__init__
and which is not json serializable, the state class will complain when saving the settings.To Reproduce
Create a model extension with an attribute that is not json serializable and run a simulation.
Additional context
The state class stores the settings and metadata as a json (see here). Part of the settings object is the parameters of the different model parts. These parameters are set here. This
param
property ofBaseModel
is constructed by looping over parameters in the signature ofclass.__init__
and getting the current values of these parametes as a class attribute. If the current value is not json serializable, this will give a problem when the state class tries to store the settings.Another problem is that this method of storing the model parameters only works if the arguments to
__init__
are actually used as class attributes, which need not be the case.The text was updated successfully, but these errors were encountered: