Skip to content

Conversation

@mjohanse-emr
Copy link
Collaborator

@mjohanse-emr mjohanse-emr commented Jul 11, 2025

What does this Pull Request accomplish?

Adds functions to convert:

  • DoubleAnalogWaveform -> AnalogWaveform (and vice versa)
  • PrecisionTimestamp -> bintime.DateTime (and vice versa)

This logic was copied from the existing converters and altered slightly because they are no longer members of a class.

These are standalone functions that will be called from the existing Converter objects. The desire is to have the minimum logic required to convert from python object to protobuf message in ni-apis-python and the rest of the conversion infrastructure stay where it is.

I also copied the applicable existing unit tests for the conversion logic into ni-apis-python (test_waveform_conversion.py).

To do this, I had to add a dependency on nitypes and update the lock file. I also had to add a "test" dependency on hightime so we can use a pre-release version with compatible float inputs.

There will be a subsequent PR to update the existing converters to use these lower level converter functions and delete any now-unnecessary unit tests.

Why should this Pull Request be merged?

Part of AB#3164754

What testing has been done?

Unit tests, mypy, styleguide, pyright.

Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2025

Test Results

 20 files  ±  0   20 suites  ±0   4s ⏱️ +2s
 20 tests + 11   20 ✅ + 11  0 💤 ±0  0 ❌ ±0 
200 runs  +110  200 ✅ +110  0 💤 ±0  0 ❌ ±0 

Results for commit 11e8602. ± Comparison against base commit a578c04.

♻️ This comment has been updated with latest results.

Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@mjohanse-emr mjohanse-emr requested a review from bkeryan July 11, 2025 20:18
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@mjohanse-emr mjohanse-emr requested a review from bkeryan July 14, 2025 19:58
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@mjohanse-emr mjohanse-emr requested a review from bkeryan July 14, 2025 20:16
@mjohanse-emr mjohanse-emr merged commit 56fbbd0 into main Jul 14, 2025
14 checks passed
@mjohanse-emr mjohanse-emr deleted the users/mjohanse/waveform_converters branch July 14, 2025 21:16
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