Skip to content
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

set_lim() does not set low limit #299

Closed
prjemian opened this issue Feb 18, 2020 · 1 comment
Closed

set_lim() does not set low limit #299

prjemian opened this issue Feb 18, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@prjemian
Copy link
Contributor

Looks like copy/pasta error:

            yield from bps.mv(
                self.soft_limit_lo, min(low, high),
                self.soft_limit_hi, max(low, high),
            )
@prjemian prjemian added the bug label Feb 18, 2020
@prjemian prjemian added this to the 1.2.2 milestone Feb 18, 2020
@prjemian prjemian self-assigned this Feb 18, 2020
@prjemian
Copy link
Contributor Author

Look at full context:

apstools/apstools/devices.py

Lines 1199 to 1217 in db8891b

def set_lim(self, low, high):
"""
Sets the low and high limits of motor
* No action taken if motor is moving.
* Low limit is set to lesser of (low, high)
* High limit is set to greater of (low, high)
Similar with SPEC command
"""
if not self.moving:
lo = min(low, high)
hi = max(low, high)
# update EPICS
yield from bps.mv(
self.soft_limit_lo, min(low, high),
self.soft_limit_hi, max(low, high),
)
# ophyd metadata dictionary will update via CA monitor

No error here. Only two unnecessary lines to remove for #298.

apstools/apstools/devices.py

Lines 1210 to 1211 in db8891b

lo = min(low, high)
hi = max(low, high)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant