Skip to content

Conversation

rahulr-NI
Copy link
Contributor

@rahulr-NI rahulr-NI commented Jul 8, 2025

  • This contribution adheres to CONTRIBUTING.md.
  • I've updated CHANGELOG.md if applicable.
  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

Support Enum flags with type ViUInt64

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

What testing has been done?

Ensure that there are no failures in tox build.

@rahulr-NI rahulr-NI changed the title Enabling Enum Flags plugin changes Enabling enum flags plugin changes Jul 8, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.99%. Comparing base (a488e07) to head (70440b2).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
generated/nifake/nifake/_grpc_stub_interpreter.py 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2114      +/-   ##
==========================================
- Coverage   91.24%   88.99%   -2.26%     
==========================================
  Files          67       71       +4     
  Lines       16386    18950    +2564     
==========================================
+ Hits        14952    16865    +1913     
- Misses       1434     2085     +651     
Flag Coverage Δ
codegenunittests 84.44% <ø> (ø)
nidcpowersystemtests 94.65% <ø> (+0.04%) ⬆️
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.26% <ø> (ø)
nidigitalunittests 68.44% <ø> (ø)
nidmmsystemtests 92.72% <ø> (ø)
nifakeunittests 86.81% <93.75%> (+0.09%) ⬆️
nifgensystemtests 94.86% <ø> (ø)
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
nirfsgsystemtests 74.45% <ø> (?)
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 Δ
generated/nifake/nifake/_visatype.py 100.00% <100.00%> (ø)
generated/nifake/nifake/enums.py 100.00% <100.00%> (ø)
generated/nifake/nifake/session.py 80.42% <100.00%> (+0.21%) ⬆️
generated/nifake/nifake/_grpc_stub_interpreter.py 83.33% <50.00%> (-0.28%) ⬇️

... and 5 files 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 a488e07...70440b2. Read the comment docs.

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

@rahulr-NI rahulr-NI marked this pull request as ready for review July 8, 2025 17:42
@ni-jfitzger
Copy link
Collaborator

Has there been a discussion of the desired FlagBoundary behavior?

The default for IntFlag is Keep, whereas the default for Flag is Strict (which raises an error for unsupported values, before the user can ever pass it to the driver). I would think Strict would be preferred, but maybe your team has a different preference or maybe it's a per-Enum decision?

@ni-jfitzger
Copy link
Collaborator

ni-jfitzger commented Jul 14, 2025

Has there been a discussion of the desired FlagBoundary behavior?

The default for IntFlag is Keep, whereas the default for Flag is Strict (which raises an error for unsupported values, before the user can ever pass it to the driver). I would think Strict would be preferred, but maybe your team has a different preference or maybe it's a per-Enum decision?

This was discussed externally.
Because the FlagBoundary behavior is new in Python 3.11, and for some other minor reasons, as well, we won't enforce valid values, for now. We aren't concerned about bad things happening if the user has an invalid bit toggled on in the value that we pass to NI-RFSG. We might change this in a future PR/release.

@ni-jfitzger ni-jfitzger merged commit 37ea6ef into ni:master Jul 14, 2025
39 checks passed
@ni-jfitzger ni-jfitzger changed the title Enabling enum flags plugin changes Enabling enum flags in APIs Jul 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants