Skip to content

Commit

Permalink
Merge pull request #1120 from slactjohnson/nttable-npint
Browse files Browse the repository at this point in the history
BUG: Add a case in p4p_plugin_component.py for Numpy integers.
  • Loading branch information
nstelter-slac authored Jan 24, 2025
2 parents 6cf1d8d + f196c2e commit 4a10536
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pydm/data_plugins/epics_plugins/p4p_plugin_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ def send_new_value(self, value: Value) -> None:
self.new_value_signal[str].emit(new_value)
elif isinstance(new_value, dict):
self.new_value_signal[dict].emit(new_value)
elif isinstance(new_value, np.integer):
self.new_value_signal[int].emit(int(new_value))
else:
raise ValueError(f"No matching signal for value: {new_value} with type: {type(new_value)}")
# Sometimes unchanged control variables appear to be returned with value changes, so checking against
Expand Down
2 changes: 1 addition & 1 deletion pydm/tests/data_plugins/test_p4p_plugin_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def generate_control_variables(value):
1,
),
(NTEnum().wrap({"index": 0, "choices": ["YES", "NO", "MAYBE"]}), False, 0, 2),
],
], # Add cases for testing NTTable containing np.integer and np float types arrays here
)
def test_send_new_value(
monkeypatch: MonkeyPatch,
Expand Down

0 comments on commit 4a10536

Please sign in to comment.