get_channel_name() should be deprecated and replaced by get_channel_names() in nifgen, and niswitch
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 128
- Forks
- 110
- Avg merge
- 5d 14h
- Merged PRs (30d)
- 10
Description
Description of issue
nifgen and niswitch Python bindings contain get_channel_name(index) method whose input is a single 1-based channel index. Being 1-based contradicts with the GetChannelNameFromString(), which is 0-based, present in some (niscope, nidigital) MI APIs and may one day be added to the nifgen or niswitch APIs.
As per the decision here:
get_channel_name(index)should be deprecated in nifgen, and niswitch.- Consider using Deprecated library for this.
- Create an issue for getting rid of it altogether eventually and attach it to 2.0 Source Breakers milestone
- Add
get_channel_names(indices)- Since
GetChannelNameFromString()is not present in the C API of these drivers, a fancy function needs to be written in Python for callingGetChannelNamein a loop and aggregating the results in a list. Ideally, the fancy function is single-sourced for all 3 bindings. - We would also need to write tests to verify the behavior of
get_channel_names(indices)using fancy function is identical to its counterparts in niscope and nidigital which useGetChannelNameFromString() - Additionally, if and when
GetChannelNameFromString()is added to C API, the implementation in Python should be switched over from fancy function to C entry point. Eventually, we should be able to get rid of the fancy function altogether.
- Since
Note: This issue originally referenced nidcpower too, but it got moved to these newly created issues - #1586 and #1588.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate get_channel_name in the nifgen and niswitch Python bindings, then compare the corresponding get_channel_names behavior and tests in niscope and nidigital. Read how the bindings expose GetChannelName and how the existing tests cover it; done means both bindings deprecate the old method, add the list-based method, and verify equivalent behavior with tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100