Skip to content

Commit

Permalink
Merge pull request #1030 from BCDA-APS/1025-clarify
Browse files Browse the repository at this point in the history
Simplify this expression
  • Loading branch information
prjemian authored Oct 24, 2024
2 parents cb5779b + 358707f commit 084fcb5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions apstools/devices/positioner_soft_done.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,13 @@ def cleanup(self):
self.readback.unsubscribe_all()
self.setpoint.unsubscribe_all()

# fmt: off
@property
def actual_tolerance(self):
return (
self.tolerance.get()
if self.tolerance.get() >= 0
else 10 ** (-1 * self.precision)
)
# fmt: on
tolerance = self.tolerance.get()
if tolerance < 0:
# Use EPICS-defined precision.
tolerance = 10 ** (-1 * self.precision)
return tolerance

def cb_update_target(self, value, *args, **kwargs):
self.target.put(value)
Expand Down

0 comments on commit 084fcb5

Please sign in to comment.