Skip to content

Commit

Permalink
Merge pull request #2484 from astrofrog/unit-conversion-fixes
Browse files Browse the repository at this point in the history
Fix bugs with attribute display units
  • Loading branch information
astrofrog authored Apr 17, 2024
2 parents 1981b68 + f924177 commit 746b40e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 3 deletions.
Empty file modified glue/config_gen.py
100755 → 100644
Empty file.
4 changes: 3 additions & 1 deletion glue/core/state_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ def update_values(self, force=False, use_default_modifiers=False, **properties):

self._previous_units = display_units

if set(properties) == {'display_units'}:
if (set(properties) == {'display_units'} and
self.lower is not None and
self.upper is not None):

converter = UnitConverter()

Expand Down
Empty file modified glue/main.py
100755 → 100644
Empty file.
3 changes: 1 addition & 2 deletions glue/viewers/image/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,7 @@ def format_unit(unit):

ImageLayerState.attribute_display_unit.set_display_func(self, format_unit)

self.add_callback('attribute', self._update_attribute_display_unit_choices)
# self.add_callback('attribute_display_unit', self._convert_attribute_limits_units, echo_old=True)
self.add_callback('attribute', self._update_attribute_display_unit_choices, priority=10000)

self._update_attribute_display_unit_choices()

Expand Down
Empty file modified glue/viewers/matplotlib/tests/test_state.py
100755 → 100644
Empty file.

0 comments on commit 746b40e

Please sign in to comment.