nimi-python
nimi-python copied to clipboard
NI-Digital: `get_channel_names()` should be a private method in `_SessionBase` as calling it with `session.channels` does not make sense
Description of issue
A user can use get_channel_names() as follows: my_session.channels[[0,1,2]].get_channel_names("0-2").
This is equivalent to no sense. It's equivalent in functionality to my_session.get_channel_names("0-2") but the channels[] part is ignored. It should not be allowed to call the method in this manner.
The reason this happens is that currently, nidigital renders its get_channel_names() method directly in _SessionBase as public method in order to support its get_pin_results_pin_information() method. One way of fixing this is to make it a private method instead.
Notes: Address https://github.com/ni/nimi-python/pull/1757#discussion_r901923413