Skip to content

Commit

Permalink
markers: ensure units stored as string (#3135)
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry authored Aug 9, 2024
1 parent 7826a99 commit 60c9ae6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jdaviz/configs/imviz/plugins/coords_info/coords_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def _image_viewer_update(self, viewer, x, y):
dq_text = ''
self.row1b_text = f'{value:+10.5e} {unit}{dq_text}'
self._dict['value'] = float(value)
self._dict['value:unit'] = unit
self._dict['value:unit'] = str(unit)
self._dict['value:unreliable'] = unreliable_pixel
else:
self.row1b_title = ''
Expand All @@ -519,9 +519,9 @@ def _image_viewer_update(self, viewer, x, y):
def _spectrum_viewer_update(self, viewer, x, y):
def _cursor_fallback():
self._dict['axes_x'] = x
self._dict['axes_x:unit'] = viewer.state.x_display_unit
self._dict['axes_x:unit'] = str(viewer.state.x_display_unit)
self._dict['axes_y'] = y
self._dict['axes_y:unit'] = viewer.state.y_display_unit
self._dict['axes_y:unit'] = str(viewer.state.y_display_unit)
self._dict['data_label'] = ''

def _copy_axes_to_spectral():
Expand Down Expand Up @@ -643,7 +643,7 @@ def _copy_axes_to_spectral():
self.row3_title = 'Flux'
self.row3_text = f'{closest_flux:10.5e} {flux_unit}'
self._dict['axes_y'] = closest_flux
self._dict['axes_y:unit'] = viewer.state.y_display_unit
self._dict['axes_y:unit'] = str(viewer.state.y_display_unit)

if closest_icon is not None:
self.icon = closest_icon
Expand Down

0 comments on commit 60c9ae6

Please sign in to comment.