Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Create the
nidaqmx/channels.py
file to import the channel types gracefully.The file improves typing annotations. Without the file, there are warnings about accessing
_task_modules
, which is a private module, when getting theChannel
class or its subclasses.What does this Pull Request accomplish?
Expose channel classes from
nidaqmx._task_modules.channels
, primarily for typing annotations, but not limiting to it.Why should this Pull Request be merged?
As Python has adopted optional typing annotations, various IDEs help writing code by providing the methods available for a variable. This significantly increases the speed of the code writing, without damaging the quality. Unfortunately, without the file I propose, I can't annotate, for instance, what the
Task.ai_channels.add_ai_voltage_chan()
function returns.What testing has been done?
No regression testing has been done by me, for it requires a piece of hardware I'm not allowed to use for the purpose of the testing. However, I do use the code in my copy of
nidaqmx
for more than a year, and it has not caused any troubles.