-
Notifications
You must be signed in to change notification settings - Fork 28
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
ENH:Questionnaire Motor Guess #51
Conversation
happi/backends/qs_db.py
Outdated
Type of EpicsMotor. If not, we assume can use pcdsd | ||
""" | ||
for _typ in motor_types: | ||
if _typ in prefix: |
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.
Might want to be more robust than this, just in case a motor comes through with a wonky name like XPP:USR:MZM:AMMN
... contrived example, I know. I suggest checking prefix.split(':')
and trying to match a piece of it.
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.
Actually, forget about this, we have to strip this out when the questionnaire gets updated anyway.
Just make sure you take care of the flake8 issue that travis is mad about 👍 |
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
- Coverage 89.86% 89.79% -0.07%
==========================================
Files 11 11
Lines 592 598 +6
==========================================
+ Hits 532 537 +5
- Misses 60 61 +1
Continue to review full report at Codecov.
|
Okay one more thought. This will break for anything older than the current |
I think if we've committed to making this dependency implicit, there's nothing to explicitly do about it. Libraries that need an older |
DO NOT MERGE UNTIL pcdshub/pcdsdevices#167
Description
When loading motors from the Questionnaire, guess which type each is by looking at the prefix. I view this is a temporary fix until the QuestionnaireClient can tell us explicitly which class should be loaded.
Question: Should the default be
pcdsdevices.epics_motor.PCDSMotorBase
orophyd.EpicsMotor
? Not sure ... My only thought is that our base version will work on true MotorRecord motors, but theEpicsMotor
won't work with our bastards.Motivation and Context
Without this fix Newport and PMC100 motors will not load properly from the Questionnaire.
How Has This Been Tested?
Added tests for both guessing the motor type, and that it works in situ.