Import _complextype conditionally based on the usage of complex type for individual drivers

Open
#2,105 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start by inspecting the generated individual driver modules and the ${module_name}._complextype import shown in the issue. Trace how each module's use of complex types is determined, including whether _visatype is also imported unnecessarily. Done means drivers import these modules only when their generated code uses them, with existing generation and import checks still passing.

Written by the indexing model from the issue text.

Description

We should solve the needless import of _complextype together with needless import of _visatype (if such thing happens). In its own PR. Please open an issue.

Originally posted by @marcoskirsch in https://github.com/ni/nimi-python/pull/2098#discussion_r2129228871

Currently _complextype is imported for all the modules (as shown below) . We need to conditionally import it based on its usage
${module_name}._complextype import * # noqa: F401,F403,H303

Importing of _complextype gives capability of including the complex data types.

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

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.

More from ni/nimi-python

All issues in ni/nimi-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.