diff --git a/glue/config_gen.py b/glue/config_gen.py old mode 100755 new mode 100644 diff --git a/glue/core/state_objects.py b/glue/core/state_objects.py index 26f98b28d..6262964ed 100644 --- a/glue/core/state_objects.py +++ b/glue/core/state_objects.py @@ -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() diff --git a/glue/main.py b/glue/main.py old mode 100755 new mode 100644 diff --git a/glue/viewers/image/state.py b/glue/viewers/image/state.py index e9eac8aaa..a40346893 100644 --- a/glue/viewers/image/state.py +++ b/glue/viewers/image/state.py @@ -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() diff --git a/glue/viewers/matplotlib/tests/test_state.py b/glue/viewers/matplotlib/tests/test_state.py old mode 100755 new mode 100644