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
nidcpower advanced sequencing #957
Conversation
Codecov Report
@@ Coverage Diff @@
## master #957 +/- ##
=======================================
Coverage 83.82% 83.82%
=======================================
Files 26 26
Lines 5742 5742
=======================================
Hits 4813 4813
Misses 929 929
Continue to review full report at Codecov.
|
generated/nidcpower/session.py
Outdated
|
||
Test. | ||
|
||
Note: Test. |
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.
As you mention, documentation is still outstanding
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.
I don't want to put in the effort to fix it in case we end up doing something different.
Sounds like documentation isn't fixed. I'm unresolving this to help us, the reviewers, track this being resolved.
How do we handle channels? Do we require the call happen on the channels rep_cap container, even though Can the channel change per step? Or in a single step, can there be different configurations per channel? If so, option 1 doesn't work as is. |
After some experimentation. How to get the attribute ID given the Python name of the attribute, DRY version: >>> nidmm.Session.__bases__[0].__dict__['range']._attribute_id
1250002 How to set an attribute given the Python name of the attribute, DRY version: >>> setattr(s, 'range', 100)
>>> s.range
100.0 I like this better than duplicating known information in the code, and adding complexity to the mako template. The drawback is that this requires knowledge of the "private" aspects of Attribute. I think this is ok, it's all within the same module and test suite. |
NI-DCPower only allows sequences in single-channel sessions, so we're ok not passing a channel. |
I think we should close this PR until it's ready to be looked at. |
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.
This doesn't support "commit step" functionality that was added to NI-DCPower recently. I think that's ok, it can be added in a separate PR but we should make sure it's tracked with an issue.
This feature may warrant an example.
I'm very concerned that I don't see how this API can accomodate multi-channel sequences should support be added. Do you have any ideas?
for step in sequence: | ||
for key in step: | ||
if key not in Session.__base__.__dict__: | ||
raise TypeError('{0} is not an property on the nidcpower Session class'.format(key)) |
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.
Why TypeError
and not KeyError
?
the nidcpower Session class
-> nidcpower.Session
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.
KeyError
is an implementation detail, and I thought TypeError
more appropriate. And to be consistent with the other error condition. Since I don't have a strong opinion though, do you want me to change it?
Changed to nidcpower.Session
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.
I think it's more correct to return KeyError when the name is bogus and TypeError when the name is for something that exists but isn't a property.
Closing this based on #504 (comment) |
What does this Pull Request accomplish?
List issues fixed by this Pull Request below, if any.
What testing has been done?