-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Codify model restrictions and defaults #32
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any way to over-ride/bypass restrictions for experimentation (without fiddling with the yaml)? E.g. optional arg
|
||
if isinstance(restriction, list): | ||
if len(restriction) == 2: | ||
if not restriction[0] <= setting <= restriction[1]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would I specify a restriction that is >0, but unbounded? Is there an easy way to specify inf
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val: [!!float inf]
works for infinity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a great example of "make the regular case easy and the exotic case possible".
If several models with Inf bounds come along, it could be worth special-casing. Until then, let's not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, just wondered whether it was possible given there may be properties that may be unbounded. There's also the common sense argument, that there doesn't have to be a restriction, but if you e.g. stick negative numbers in, expect strange results.
There isn't a simple way to bypass the restrictions (neither in this PR nor in the og implementation) - and in fact the discussion between raising an exception or using |
Actually, we have found that it is possible to mutate the EDIT: fyi: I have just discovered that |
Resolves #23
restrictions
anddefaults
keys in itsparameters
dictionary (and therefore changes the YAML spec in Add YAML file specification #19).