Skip to content

Commit

Permalink
Merge pull request #461 from astrofrog/fix-contour-units-update
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog authored Aug 13, 2024
2 parents ba37e39 + 76691b7 commit 8434cb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions glue_jupyter/bqplot/image/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(self, *args, **kwargs):
self.add_callback('level_mode', self._update_levels)
self.add_callback('levels', self._update_labels)
self.add_callback('attribute_display_unit', self._convert_units_c_limits, echo_old=True)
self._convert_units_c_limits(None, None)

self._update_levels()

Expand Down
2 changes: 2 additions & 0 deletions glue_jupyter/bqplot/image/tests/test_visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def test_contour_units(

assert_allclose(image.state.layers[0].levels, [0.1, 0.3, 0.5, 0.7, 0.9])

image.state.layers[0].attribute_display_unit = 'mm'
image.state.layers[0].attribute_display_unit = 'km'
image.state.layers[0].attribute_display_unit = 'm'

assert_allclose(image.state.layers[0].levels, [100, 300, 500, 700, 900])
Expand Down

0 comments on commit 8434cb4

Please sign in to comment.