Skip to content

Commit

Permalink
make check for n_bins more robust/performant
Browse files Browse the repository at this point in the history
tests were occasionally failing because they relied on an exception in the live-update which sometimes did not trigger in time.
  • Loading branch information
kecnry committed Jan 10, 2024
1 parent c7776c4 commit 8503d3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lcviz/plugins/binning/binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8503d3f

Please sign in to comment.