From 8503d3f414eeb8eea134a10c8e4cdf04ad9024d8 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 10 Jan 2024 08:33:23 -0500 Subject: [PATCH] make check for n_bins more robust/performant tests were occasionally failing because they relied on an exception in the live-update which sometimes did not trigger in time. --- lcviz/plugins/binning/binning.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lcviz/plugins/binning/binning.py b/lcviz/plugins/binning/binning.py index 3c3dcd4d..2969f226 100644 --- a/lcviz/plugins/binning/binning.py +++ b/lcviz/plugins/binning/binning.py @@ -157,9 +157,10 @@ def _toggle_marks(self, event={}): 'n_bins', 'previews_temp_disable') @skip_if_no_updates_since_last_active() def _live_update(self, event={}): - if not self.show_live_preview or not self.is_active: + self.bin_enabled = self.n_bins != '' and self.n_bins > 0 + + if not self.show_live_preview or not self.is_active or not self.bin_enabled: self._clear_marks() - self.bin_enabled = self.n_bins != '' and self.n_bins > 0 return if self.previews_temp_disable: