-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fixes issue 295 #296
base: master
Are you sure you want to change the base?
Fixes issue 295 #296
Conversation
symfit/core/support.py
Outdated
if min is None or max is None: | ||
pass | ||
elif min > max: | ||
raise ValueError('The value of `min` should be less than or' | ||
' equal to the value of `max`.') |
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.
Could you condense these conditions? min is not None and max is not None and min > max
?
Alternatively, completely remove the check here, and make min/max a property of Parameter, and do the checking in the setter. That should clean up some logic around the place.
Removed min/max check because its already in ``Parameter``'s init
Edited on GitHub which also added a newline at the end of the file |
Ok, but then you also need to add the Parameter.min and Parameter.max properties... Currently we'd just lose a useful check instead of moving it. |
The current check I've removed was redundant because its also in the In any case, the getter/setter would still add functionality because it prevents users from setting faulty limits after initialization of the parameters. |
Of course, once there's setter methods the check in |
Ah I see, |
Yeah I agree that putting this check in the setter is probably a nicer solution. Another solution could be to initiate each object properly and not set it after the fact. |
Checks if any bounds are none before comparing min/min
For some reason there are some commits listed which are already on symfit master