mxcube / mxcubecore

Backend used by MXCuBE
http://mxcube.github.io/mxcube/
GNU Lesser General Public License v3.0
11 stars 51 forks source link

sardana motors: handle limit 0.0 correctly #825

Closed elmjag closed 7 months ago

elmjag commented 7 months ago

The taurus Quantity(0.0) value evaluates to false. Thus when motor's limit is set to exactly 0.0 the code:

if minval:
   <save limit>

will not run the if-body. Check explicitly for None values of minval and maxval variables to avoid this problem.

beteva commented 7 months ago

Fine with me. Indeed this is better handling of the limits.