Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Apr 17, 2023
1 parent 7c8b225 commit 83a1710
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions jdaviz/core/marks.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ def __init__(self, *args, **kwargs):
self.auto_update_units = True
self.hub.subscribe(self, GlobalDisplayUnitChanged,
handler=self._on_global_display_unit_changed)
self._update_units()

if not self.auto_update_units:
return
if self.xunit is None:
self.set_x_unit()
if self.yunit is None:
self.set_y_unit()

@property
def hub(self):
Expand All @@ -82,14 +88,6 @@ def append_xy(self, x, y):
self.x = np.append(self.x, x)
self.y = np.append(self.y, y)

def _update_units(self):
if not self.auto_update_units:
return
if self.xunit is None:
self.set_x_unit()
if self.yunit is None:
self.set_y_unit()

def set_x_unit(self, unit=None):
if unit is None:
if not hasattr(self.viewer.state, 'x_display_unit'):
Expand Down

0 comments on commit 83a1710

Please sign in to comment.