nimi-python icon indicating copy to clipboard operation
nimi-python copied to clipboard

Custom object expansion for repeated capabilities

Open Vaishnavigupta1312 opened this issue 8 months ago • 2 comments

  • [x] This contribution adheres to CONTRIBUTING.md.

  • [x] I've updated CHANGELOG.md if applicable.

  • [x] I've added tests applicable for this pull request

What does this Pull Request accomplish?

Currently to set an attribute with repeated capability, we create a new _SessionBase instance with repeated_capability information passed at the time of initalization. The information of repeated capability stored in this new _SessionBase instance is used when dispatching call to the interpreter session to set the value in the driver. Repeated Capabilities can be handled in a way that avoids going down this route.

  • Adding new class _RepeatedCapabilityBase to serve as the base class for each of the repeated capability type, for eg _RepeatedCapablityScript for script.
  • These new capability specific classes will contain the attributes supporting that repeated capability.
  • Example of existing flow using a script attribute. image
  • Proposed flow using same script example, changes are highlighted using red font. image

Changes are made to the helper scripts and session mako template to support custom object expansion of the applicable only attributes.

List issues fixed by this Pull Request below, if any.

  • Fix: https://github.com/ni/nimi-python/issues/2038

What testing has been done?

  • Successful tox build without any errors.
  • No failure of newly added unit test.

Vaishnavigupta1312 avatar May 16 '25 11:05 Vaishnavigupta1312

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.33%. Comparing base (9efe042) to head (2faedc0). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
build/helper/documentation_helper.py 25.00% 3 Missing :warning:
build/helper/metadata_filters.py 50.00% 1 Missing :warning:
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2100      +/-   ##
==========================================
- Coverage   91.34%   91.33%   -0.01%     
==========================================
  Files          66       66              
  Lines       16292    16301       +9     
==========================================
+ Hits        14882    14889       +7     
- Misses       1410     1412       +2     
Flag Coverage Δ
codegenunittests 84.85% <60.00%> (-0.11%) :arrow_down:
nidcpowersystemtests 94.59% <ø> (+0.04%) :arrow_up:
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.26% <ø> (ø)
nidigitalunittests 68.44% <ø> (ø)
nidmmsystemtests 92.72% <ø> (ø)
nifakeunittests 87.24% <ø> (ø)
nifgensystemtests 94.86% <ø> (ø)
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
niscopesystemtests 92.94% <ø> (ø)
niscopeunittests 43.20% <ø> (ø)
nisesystemtests 91.50% <ø> (ø)
niswitchsystemtests 82.03% <ø> (ø)
nitclksystemtests 94.87% <ø> (ø)
nitclkunittests 98.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
build/helper/__init__.py 100.00% <100.00%> (ø)
build/helper/documentation_snippets.py 85.18% <100.00%> (+0.27%) :arrow_up:
build/helper/metadata_add_all.py 80.84% <100.00%> (+0.08%) :arrow_up:
build/helper/metadata_filters.py 78.72% <50.00%> (-0.63%) :arrow_down:
build/helper/documentation_helper.py 88.12% <25.00%> (-0.32%) :arrow_down:

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 9efe042...2faedc0. Read the comment docs.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar May 16 '25 11:05 codecov-commenter

The description for this PR is not sufficient. I'd like to see a theory of operation. I don't think you've reasoned through all of the use cases. You could probably stand to add some more tests. If nothing else, you should test your new error behavior.

ni-jfitzger avatar May 16 '25 18:05 ni-jfitzger