Skip to content

Add conversion methods for Vector#54

Merged
mjohanse-emr merged 8 commits into
mainfrom
users/mjohanse/vector_converters
Aug 15, 2025
Merged

Add conversion methods for Vector#54
mjohanse-emr merged 8 commits into
mainfrom
users/mjohanse/vector_converters

Conversation

@mjohanse-emr

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

Copy link
Copy Markdown
Collaborator

What does this Pull Request accomplish?

Add the vector_to_protobuf and vector_from_protobuf methods to a new file vector_conversion.py. These methods convert the vector_pb2.Vector protobuf type to the Vector python type and vise versa.

Add unit tests for Vector to test_ni_protobuf_types.py.
Add new unit tests for vector conversion to test_vector_conversion.py

Refactor conversion methods for AttributeValue into attribute_value_conversion.py and update both scalar_conversion and vector_conversion to use them.

Why should this Pull Request be merged?

Implements AB#3218062

What testing has been done?

Unit tests, mypy, pyright, styleguide.

Michael Johansen added 3 commits August 9, 2025 14:36
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@github-actions

github-actions Bot commented Aug 11, 2025

Copy link
Copy Markdown
Contributor

Test Results

   26 files  ±  0     26 suites  ±0   29s ⏱️ +2s
  136 tests + 20    136 ✅ + 20  0 💤 ±0  0 ❌ ±0 
1 344 runs  +200  1 344 ✅ +200  0 💤 ±0  0 ❌ ±0 

Results for commit 708edbe. ± Comparison against base commit 394a0d4.

♻️ This comment has been updated with latest results.

Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/attribute_value_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/attribute_value_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/vector_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/attribute_value_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/vector_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/vector_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/scalar_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/scalar_conversion.py Outdated
Comment thread packages/ni.protobuf.types/src/ni/protobuf/types/vector_conversion.py Outdated
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@mjohanse-emr mjohanse-emr requested a review from bkeryan August 11, 2025 19:22

@bkeryan bkeryan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved with suggestions

Michael Johansen added 4 commits August 12, 2025 08:50
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
Signed-off-by: Michael Johansen <michael.johansen@ni.com>
@mjohanse-emr mjohanse-emr merged commit f9f5ecf into main Aug 15, 2025
24 checks passed
@dixonjoel dixonjoel deleted the users/mjohanse/vector_converters branch November 18, 2025 20:25
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