Skip to content

Commit 746b40e

Browse files
authored
Merge pull request #2484 from astrofrog/unit-conversion-fixes
Fix bugs with attribute display units
2 parents 1981b68 + f924177 commit 746b40e

File tree

5 files changed

+4
-3
lines changed

5 files changed

+4
-3
lines changed

glue/config_gen.py

100755100644
File mode changed.

glue/core/state_objects.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ def update_values(self, force=False, use_default_modifiers=False, **properties):
332332

333333
self._previous_units = display_units
334334

335-
if set(properties) == {'display_units'}:
335+
if (set(properties) == {'display_units'} and
336+
self.lower is not None and
337+
self.upper is not None):
336338

337339
converter = UnitConverter()
338340

glue/main.py

100755100644
File mode changed.

glue/viewers/image/state.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,7 @@ def format_unit(unit):
536536

537537
ImageLayerState.attribute_display_unit.set_display_func(self, format_unit)
538538

539-
self.add_callback('attribute', self._update_attribute_display_unit_choices)
540-
# self.add_callback('attribute_display_unit', self._convert_attribute_limits_units, echo_old=True)
539+
self.add_callback('attribute', self._update_attribute_display_unit_choices, priority=10000)
541540

542541
self._update_attribute_display_unit_choices()
543542

glue/viewers/matplotlib/tests/test_state.py

100755100644
File mode changed.

0 commit comments

Comments
 (0)