Skip to content

Conversation

@jfriedri-ni
Copy link
Collaborator

@jfriedri-ni jfriedri-ni commented May 14, 2025

What does this Pull Request accomplish?

This PR implements getting and setting panel values that use builtin Python scalar-like types

  • int
  • string
  • float
  • bool
  • bytes

With partial support for

  • enum.IntFlag
  • enum.IntEnum
  • enum.StrEnum

And a baseline extensible converter collection.

Why should this Pull Request be merged?

This is core functionality for the package.

What testing has been done?

New tests

  • test___unopened_panel___set_value___sets_value
  • test___unopened_panel___get_unset_value___raises_exception
  • test___unopened_panel___get_set_value___gets_value
  • test___builtin_scalar_types___set_value___gets_same_value

Hand test

  • Run placeholder.py with a genuine NI.PythonPanel.V1.Service.exe running

@github-actions
Copy link
Contributor

github-actions bot commented May 14, 2025

Test Results

 10 files  ±  0   10 suites  ±0   6s ⏱️ -1s
 24 tests + 18   24 ✅ + 18  0 💤 ±0  0 ❌ ±0 
210 runs  +150  210 ✅ +150  0 💤 ±0  0 ❌ ±0 

Results for commit 83e6363. ± Comparison against base commit 5b1cef0.

♻️ This comment has been updated with latest results.

Copy link
Collaborator Author

@jfriedri-ni jfriedri-ni left a comment

Choose a reason for hiding this comment

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

Here are some of the larger tradeoffs and decisions we need to make.

@jfriedri-ni jfriedri-ni requested a review from bkeryan May 14, 2025 17:34
Signed-off-by: Joe Friedrichsen <[email protected]>
…can access DESCRIPTOR

Signed-off-by: Joe Friedrichsen <[email protected]>
Copy link
Collaborator Author

@jfriedri-ni jfriedri-ni left a comment

Choose a reason for hiding this comment

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

Assuming we want a Protocol or an ABC, I'm unsure how to correctly appease the type checker given how the code uses the converters.

@jfriedri-ni jfriedri-ni requested a review from bkeryan May 21, 2025 17:00
@jfriedri-ni jfriedri-ni changed the title Preview and RFC for supporting builtin types for get_value and set_value Add support for builtin types for get_value and set_value May 21, 2025
@jfriedri-ni jfriedri-ni merged commit a87939a into main May 21, 2025
14 checks passed
@jfriedri-ni jfriedri-ni deleted the users/jfriedri-ni/add-get-set-panel-value branch May 22, 2025 16:00
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