Skip to content

Add support for builtin types for get_value and set_value#26

Merged
jfriedri-ni merged 41 commits into
mainfrom
users/jfriedri-ni/add-get-set-panel-value
May 21, 2025
Merged

Add support for builtin types for get_value and set_value#26
jfriedri-ni merged 41 commits into
mainfrom
users/jfriedri-ni/add-get-set-panel-value

Conversation

@jfriedri-ni

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

Copy link
Copy Markdown
Collaborator

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

Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
…med tuple

Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
@github-actions

github-actions Bot commented May 14, 2025

Copy link
Copy Markdown
Contributor

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.

@jfriedri-ni jfriedri-ni left a comment

Copy link
Copy Markdown
Collaborator Author

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.

Comment thread examples/placeholder.py
Comment thread examples/placeholder.py
Comment thread examples/placeholder.py
Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread tests/unit/test_streamlit_panel.py
Comment thread src/nipanel/_converters.py Outdated
@jfriedri-ni jfriedri-ni requested a review from bkeryan May 14, 2025 17:34
Comment thread src/nipanel/_converters.py Outdated
Comment thread examples/placeholder.py
Comment thread examples/placeholder.py
Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread tests/unit/test_streamlit_panel.py Outdated
Comment thread examples/placeholder.py
Comment thread examples/placeholder.py
Comment thread src/nipanel/_converters.py Outdated
Comment thread tests/unit/test_streamlit_panel.py
Comment thread tests/unit/test_streamlit_panel.py Outdated
Comment thread examples/placeholder.py
Comment thread examples/placeholder.py
Comment thread examples/placeholder.py
Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread tests/unit/test_streamlit_panel.py
Comment thread tests/unit/test_streamlit_panel.py
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
…hannel'

Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Comment thread tests/conftest.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
…can access DESCRIPTOR

Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>

@jfriedri-ni jfriedri-ni left a comment

Copy link
Copy Markdown
Collaborator Author

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.

Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread src/nipanel/_converters.py Outdated
Comment thread tests/conftest.py
Comment thread tests/unit/test_streamlit_panel.py
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
… is too difficult (for me)

Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
…ts_value

Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Comment thread src/nipanel/_converters.py Outdated
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com>
@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
Comment thread src/nipanel/_converters.py Outdated
Signed-off-by: Brad Keryan <brad.keryan@ni.com>
Comment thread src/nipanel/_converters.py
@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