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

nidcpower advanced sequencing #957

Closed
wants to merge 37 commits into from

Conversation

texasaggie97-zz
Copy link
Contributor

@texasaggie97-zz texasaggie97-zz commented Nov 8, 2018

  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

List issues fixed by this Pull Request below, if any.

What testing has been done?

@codecov
Copy link

codecov bot commented Nov 8, 2018

Codecov Report

Merging #957 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #957   +/-   ##
=======================================
  Coverage   83.82%   83.82%           
=======================================
  Files          26       26           
  Lines        5742     5742           
=======================================
  Hits         4813     4813           
  Misses        929      929           
Flag Coverage Δ
#codegenunittests 87.76% <0.00%> (ø) ⬆️
#nidcpowersystemtests 48.93% <0.00%> (ø) ⬆️
#nidigitalsystemtests 51.72% <0.00%> (ø) ⬆️
#nifakeunittests 96.06% <0.00%> (ø) ⬆️
#nifgensystemtests 96.91% <0.00%> (ø) ⬆️
#nimodinstsystemtests 100.00% <0.00%> (ø) ⬆️
#nimodinstunittests 95.98% <0.00%> (ø) ⬆️
#nisesystemtests 100.00% <0.00%> (ø) ⬆️
#nitclksystemtests 100.00% <0.00%> (ø) ⬆️
#nitclkunittests 100.00% <0.00%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3102037...3102037. Read the comment docs.

generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved

Test.

Note: Test.
Copy link

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

Copy link

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.

generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved
src/nidcpower/metadata/functions_addon.py Outdated Show resolved Hide resolved
src/nidcpower/metadata/functions_addon.py Outdated Show resolved Hide resolved
@texasaggie97-zz
Copy link
Contributor Author

texasaggie97-zz commented Nov 9, 2018

How do we handle channels?

Do we require the call happen on the channels rep_cap container, even though create_advanced_sequence and create_advanced_sequence_step themselves don't take a channel string?

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.

@marcoskirsch
Copy link
Member

marcoskirsch commented Nov 9, 2018

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.

@marcoskirsch
Copy link
Member

How do we handle channels?

Do we require the call happen on the channels rep_cap container, even though create_advanced_sequence and create_advanced_sequence_step themselves don't take a channel string?

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.

NI-DCPower only allows sequences in single-channel sessions, so we're ok not passing a channel.

generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved
generated/nidcpower/session.py Outdated Show resolved Hide resolved
src/nidcpower/metadata/functions_addon.py Outdated Show resolved Hide resolved
@marcoskirsch
Copy link
Member

I think we should close this PR until it's ready to be looked at.

Copy link
Member

@marcoskirsch marcoskirsch left a 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?

build/templates/tox-system_tests.ini.mako Outdated Show resolved Hide resolved
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))
Copy link
Member

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

Copy link
Contributor Author

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

Copy link
Member

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.

generated/nidcpower/nidcpower/session.py Show resolved Hide resolved
generated/nitclk/tox-system_tests.ini Outdated Show resolved Hide resolved
src/nidcpower/metadata/functions.py Show resolved Hide resolved
@marcoskirsch
Copy link
Member

Closing this based on #504 (comment)
We're implementing #1289 instead. :(

@sbethur sbethur deleted the bug504/advanced_sequencing branch March 22, 2020 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose NI-DCPower Advanced Sequences in Python API
4 participants