Skip to content

Conversation

@Vaishnavigupta1312
Copy link
Contributor

@Vaishnavigupta1312 Vaishnavigupta1312 commented Jun 6, 2025

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

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

What does this Pull Request accomplish?

  • Turned off codegen for string enums
  • Turned off codegen for APIs configuring locations in anyway.
  • Turned off waveform burst APIs since require support for parameters of type float64 list.
  • Corrected the enum value names in load options
  • Enabled session lock calls
  • Added default values for Init API
  • Corrected enum value names in nimi_python_documentation for correct redirecting of pages.
  • Updated the hightime APIs to use datetime_wrapper mako template
  • waveform burst functions removed due to parameter metadata not being right, yet. Will be added back in a future PR.

What testing has been done?

  • Tox build
  • Correct redirecting hyperlinks in rendered HTML pages.

@codecov-commenter
Copy link

codecov-commenter commented Jun 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.36%. Comparing base (9efe042) to head (b39aa24).
Report is 3 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2104      +/-   ##
==========================================
+ Coverage   91.34%   91.36%   +0.01%     
==========================================
  Files          66       66              
  Lines       16292    16318      +26     
==========================================
+ Hits        14882    14909      +27     
+ Misses       1410     1409       -1     
Flag Coverage Δ
codegenunittests 84.95% <ø> (ø)
nidcpowersystemtests 94.65% <ø> (+0.09%) ⬆️
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.

see 2 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 9efe042...b39aa24. Read the comment docs.

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

Copy link
Member

@marcoskirsch marcoskirsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm the matadata was copied exactly from internal process and not edited at all.

'GetAllNamedWaveformNames': {
'codegen_method': 'public',
'documentation': {
'description': '\n Return names of the waveforms present in the memory.\n\n **Supported Devices** :PXIe-5830/5831/5840/5841/5842E\n '
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is up with all this whitespace?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please review all for similar issues

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like after creating their C Documentation, they copy pasted it for their Python Documentation, at least to some extent.

The issue here is that our plugin for C Documentation removes common indentation, so that you can use it to keep the source readable. But the plugin for Python does not do that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from every the line after the first looking a bit indented, I think the generated documentation actually looks okay. It's a minor issue.

https://nirfsg--2104.org.readthedocs.build/en/2104/class.html#methods

I'm guessing codegen trims leading whitespace from first line before adding its own.


**Default Value:** ArbSampleClockSource.ONBOARD_CLOCK
**Default Value:** NIRFSG_VAL_ONBOARD_CLOCK_STR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't you delete this enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the default value entries got overlooked, will replace it with the actual string value.

+----------------+--------------------------------------------------------------------------------------------------------------------+
| Possible Value | Description |
+================+====================================================================================================================+
| empty | The signal is not exported. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would probably be better to replace this wih a literal empty string.
And I think you should put quotes around your other possible values.


Specifies the destination terminal for exporting the Pulse Modulation Event. The Pulse Modulation Event tracks the RF Envelope when Pulse Modulation is Enabled. If this property is set to a value other than `do not export str`, calling NI-RFSG Commit will cause the output terminal to be pulled to the logic level that is the inverse of `exported pulse modulation event active level`. You can tri-state this terminal by setting this property to `do not export str` or by calling `niRFSG Reset`. To set this property, the NI-RFSG device must be in the Configuration state.

**Default Value:** PulseModulationOutputTerm.PULSE_OUT
**Default Value:** NIRFSG_VAL_PULSE_OUT_STR
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another one that you deleted. Time to audit for the use of these deleted enums in descriptions.

+----------------+---------------------------------------------------------------------+
| Possible Value | Description |
+================+=====================================================================+
| | Pulse modulation video signal is not exported. |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's going on here? Should this value be an empty string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enum value is an empty string, confirmed with the base hapigen metadata for RFSG.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For strings, empty or otherwise, I really think it's best to use quotes.

def check_if_waveform_exists(self, waveform_name):
r'''check_if_waveform_exists

Returns whether the waveform that you specify as **WAVEFORM_NAME** exists.
Returns whether the waveform that you specify as WAVEFORM_NAME exists.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing to fix in a future PR when you comb over things.
I think what's happening here is that WAVEFORM_NAME isn't the parameter name in C, so it's not getting replaced.

Copy link
Contributor Author

@Vaishnavigupta1312 Vaishnavigupta1312 Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a function parameter in C with the same name but no corresponding constant is there for it as it is not an attribute.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the C parameter name is waveformName.

'returns': 'ViStatus',
'use_session_lock': False
},
'SetWaveformBurstStartLocations': {
Copy link
Collaborator

@ni-jfitzger ni-jfitzger Jun 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is not deleted in the latest internal metadata export. Nor do you seem to have any active internal PRs where this is set to not codegen. Did you hand-edit this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will raise a PR backporting these changes to AzDO. The file is not hand-edited.

Copy link
Collaborator

@ni-jfitzger ni-jfitzger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the issues that I see are minor and can be handled in a followup PR. However, this metadata does not match our latest internal export nor any internal PR of yours that I can see.

Before this can go in, I need to at least see an approved internal PR with your internal metadata changes. Otherwise, it's very likely that some of your changes will be erased by the next PR with metadata changes.

Additionally, your description did not mention the removal of functions. Please add that to the description along with a short reason for the removal.

And please use an "X" when filling the checkbox in the description. And surround any unchecked items with tildes: ~[ ] Thing that doesn't apply~ so that it renders as crossed out and we know you're not ignoring it.

@ni-jfitzger
Copy link
Collaborator

Corrected the parameter names in load options

Is this supposed to say Enum Value names?

@ni-jfitzger
Copy link
Collaborator

Accepting this as is. The documentation issues will be addressed in a followup task.
Tests are passing and this doesn't touch any currently shipping APIs, so we can be allow a little leeway.

Copy link
Collaborator

@ni-jfitzger ni-jfitzger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation issues will still need to be addressed in a followup PR.

@ni-jfitzger ni-jfitzger merged commit 5ca52d6 into ni:master Jun 9, 2025
36 checks passed
@Vaishnavigupta1312 Vaishnavigupta1312 deleted the users/vagupta/misc-rfsg-metadata-changes branch June 10, 2025 05:39
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.

4 participants