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
Currently, the restrictions and defaults that any given model requires are completely free-form and undefined - the only requirement are ModelData.restrictions and ModelData.defaults which create a unified interface for users to use. However, the meaning of these is in fact unclear; e.g. is a list of three values for e_initrestrictions the three allowed values or the (stop, start, step) tuple?
There is a way to improve all aspects of this by adding to the YAML file spec the fact that restrictions and defaults must be specified as dictionaries, i.e.:
which can then be used directly without accessing any underlying attributes. Further, as shown above, it can be made a part of the spec that a YAML list is interpreted as a (start, stop, step) tuple, as in range, and a YAML set is interpreted as a list of discrete values.
The text was updated successfully, but these errors were encountered:
Thinking about implementing this, it may be a good idea to push all of this to the YAML data files wholly by making the defaults and restrictionsrequired for all models, even those who do not use these. This would allow us to get rid of the ModelData.defaults and ModelData.restrictions@property-ies and instead treat them like function and citations - simple attributes. I feel like this would simplify most things (at the cost of some more boilerplate for some models in the YAML files).
On a somewhat related note, I have come to realise that there isn't much good way to identify the settings of a model - the only reliable method is the get_model_signature() method, but that retuns a lot of information and can be a bit complicated for simple queries. The other way I recommend in some of the how-to guides (#15) is to use the aforementioned ModelData.defaults and ModelData.restrictions properties, but there is no guarantee that every setting a model has, also has a default and restriction. Therefore, it might be desirable to add an item to the model YAML data that could carry the names of the settings required by a given model, e.g; settings: ['e_init', 'chopper_frequency']. What do you think?
Currently, the
restrictions
anddefaults
that any given model requires are completely free-form and undefined - the only requirement areModelData.restrictions
andModelData.defaults
which create a unified interface for users to use. However, the meaning of these is in fact unclear; e.g. is a list of three values fore_init
restrictions
the three allowed values or the (stop, start, step) tuple?There is a way to improve all aspects of this by adding to the YAML file spec the fact that
restrictions
anddefaults
must be specified as dictionaries, i.e.:which can then be used directly without accessing any underlying attributes. Further, as shown above, it can be made a part of the spec that a YAML
list
is interpreted as a (start, stop, step) tuple, as inrange
, and a YAMLset
is interpreted as a list of discrete values.The text was updated successfully, but these errors were encountered: