ni / ni/nimi-python

NI-Digital: `get_channel_names()` should be a private method in `_SessionBase` as calling it with `session.channels` does not make sense

Open
#1,758 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

API nidigital
Dominant language
Python
Stars
128
Forks
110
Avg merge
5d 14h
Merged PRs (30d)
10

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in generated/nidigital/nidigital/session.py around get_channel_names() and inspect _SessionBase, then read the linked pull request discussion. Confirm how get_pin_results_pin_information() uses the method; done means calls through session.channels are no longer exposed while that internal use remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.