Fixes issue 295 - #296
Conversation
| 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.
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