Skip to content

Conversation

@mjohanse-emr
Copy link
Collaborator

@mjohanse-emr mjohanse-emr commented Oct 9, 2025

What does this Pull Request accomplish?

  • Adds methods to convert XYData python objects to/from protobuf messages.
  • Adds unit tests for the new conversion methods.
  • Update dependencies to pull in the version of nitypes that has XYData implemented.

Request for Comment
For XYData objects that aren't of type np.float64, I'm just converting the numeric values to float during the _to_protobuf method. The alternative is to raise an error in this case. I think converting to float is more user friendly, but I can see a case for throwing an error.

Why should this Pull Request be merged?

Implements part of AB#3266236
To allow clients of ni.protobuf.types to easily convert to/from protobuf messages.

What testing has been done?

Unit tests, mypy, pyright, styleguide.

Signed-off-by: Michael Johansen <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

Test Results

  120 files  ± 0    120 suites  ±0   3m 29s ⏱️ +3s
  246 tests + 6    244 ✅ + 6   2 💤 ±0  0 ❌ ±0 
2 460 runs  +60  2 430 ✅ +60  30 💤 ±0  0 ❌ ±0 

Results for commit 61cbfa0. ± Comparison against base commit 58de145.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@bkeryan bkeryan left a comment

Choose a reason for hiding this comment

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

Approved with @csjall 's suggestion to change the type hint to use np.float64

Signed-off-by: Michael Johansen <[email protected]>
@mjohanse-emr mjohanse-emr merged commit 2eb2c66 into main Oct 13, 2025
678 of 679 checks passed
@mjohanse-emr mjohanse-emr deleted the users/mjohanse/xydata_conversion branch October 13, 2025 13: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.

5 participants