ni / ni/nimi-python

APIs allow repeated capabilities to access attributes and methods that don't support them

Open
#2,038 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description of issue

As of nimi-python 1.4.7, the way repeated capabilities work is thus:

  1. When a _RepeatedCapabilities object, such as Session.channels, is accessed, it returns a _SessionBase object with _SessionBase.repeated_capability updated, based on what's passed to index operator [].
  2. When setting an attribute or calling a method using a repeated capability, _SessionBase.repeated_capability is passed to the method or SetAttribute method.

_SessionBase is one big collection of properties and methods that support repeated capabilities, with no distinction of which repeated capabilities are supported. As an example, the nifgen API will allow a user to set an attribute that supports the data_marker repeated capability with the script_trigger repeated capability. Because we allow this, the user may be puzzled when they get back an error.

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 by reading the _RepeatedCapabilities and _SessionBase behavior described in the issue, using Session.channels and the nifgen data_marker and script_trigger examples as entry points. Determine how supported repeated capabilities are associated with attributes and methods, and consider the work done when unsupported combinations are rejected before producing a confusing API error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.