Skip to content

Commit

Permalink
Merge pull request #444 from hhslepicka/fix_check
Browse files Browse the repository at this point in the history
FIX: Address ValueError when using comparison of numpy arrays in an if statement.
  • Loading branch information
mattgibbs authored Dec 4, 2018
2 parents e434bc4 + 6778fb5 commit eb5133b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pydm/data_plugins/epics_plugins/caproto_plugin_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def clear_cache(self):

def send_new_value(self, value=None, char_value=None, count=None, typefull=None, type=None, *args, **kws):
self.update_ctrl_vars(**kws)
if value is not None and value != self._value:

if value is not None and not np.array_equal(value, self.value):
self._value = value
if isinstance(value, np.ndarray):
self.new_value_signal[np.ndarray].emit(value)
Expand Down
3 changes: 2 additions & 1 deletion pydm/data_plugins/epics_plugins/pyepics_plugin_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def clear_cache(self):

def send_new_value(self, value=None, char_value=None, count=None, ftype=None, type=None, *args, **kws):
self.update_ctrl_vars(**kws)
if value is not None and value != self.value:

if value is not None and not np.array_equal(value, self.value):
self.value = value
if isinstance(value, np.ndarray):
self.new_value_signal[np.ndarray].emit(value)
Expand Down

0 comments on commit eb5133b

Please sign in to comment.