From a1956900b038c9df83b589ef896606d5ec90f18d Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Fri, 25 Oct 2024 16:38:06 -0400 Subject: [PATCH] Rename limits_cache to _limits_cache for JSON serializability. --- glue_jupyter/common/state3d.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/glue_jupyter/common/state3d.py b/glue_jupyter/common/state3d.py index 74997214..8f850d8c 100644 --- a/glue_jupyter/common/state3d.py +++ b/glue_jupyter/common/state3d.py @@ -34,7 +34,7 @@ class ViewerState3D(ViewerState): # clip_data = CallbackProperty(False) native_aspect = CallbackProperty(False) - limits_cache = CallbackProperty() + _limits_cache = CallbackProperty() # def _update_priority(self, name): # if name == 'layers': @@ -48,34 +48,34 @@ def __init__(self, **kwargs): super(ViewerState3D, self).__init__(**kwargs) - if self.limits_cache is None: - self.limits_cache = {} + if self._limits_cache is None: + self._limits_cache = {} self.x_lim_helper = StateAttributeLimitsHelper(self, attribute='x_att', lower='x_min', upper='x_max', - cache=self.limits_cache) + cache=self._limits_cache) self.y_lim_helper = StateAttributeLimitsHelper(self, attribute='y_att', lower='y_min', upper='y_max', - cache=self.limits_cache) + cache=self._limits_cache) self.z_lim_helper = StateAttributeLimitsHelper(self, attribute='z_att', lower='z_min', upper='z_max', - cache=self.limits_cache) + cache=self._limits_cache) - # TODO: if limits_cache is re-assigned to a different object, we need to - # update the attribute helpers. However if in future we make limits_cache + # TODO: if _limits_cache is re-assigned to a different object, we need to + # update the attribute helpers. However if in future we make _limits_cache # into a smart dictionary that can call callbacks when elements are # changed then we shouldn't always call this. It'd also be nice to # avoid this altogether and make it more clean. - self.add_callback('limits_cache', nonpartial(self._update_limits_cache)) + self.add_callback('_limits_cache', nonpartial(self._update_limits_cache)) def _update_limits_cache(self): - self.x_lim_helper._cache = self.limits_cache + self.x_lim_helper._cache = self._limits_cache self.x_lim_helper._update_attribute() - self.y_lim_helper._cache = self.limits_cache + self.y_lim_helper._cache = self._limits_cache self.y_lim_helper._update_attribute() - self.z_lim_helper._cache = self.limits_cache + self.z_lim_helper._cache = self._limits_cache self.z_lim_helper._update_attribute() @property