From c8d24963ce5b17157323ffbcec418729cc3eaf2d Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Wed, 5 Jun 2024 04:10:23 -0400 Subject: [PATCH] irrelevant if no TPF data --- .../photometric_extraction/photometric_extraction.py | 8 ++++++++ lcviz/plugins/stitch/stitch.py | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lcviz/plugins/photometric_extraction/photometric_extraction.py b/lcviz/plugins/photometric_extraction/photometric_extraction.py index 56fea4a..d79925b 100644 --- a/lcviz/plugins/photometric_extraction/photometric_extraction.py +++ b/lcviz/plugins/photometric_extraction/photometric_extraction.py @@ -42,6 +42,7 @@ def __init__(self, *args, **kwargs): def is_tpf(data): return len(data.shape) == 3 self.dataset.add_filter(is_tpf) + self._set_relevant() @property def user_api(self): @@ -49,6 +50,13 @@ def user_api(self): 'add_results', 'extract'] return PluginUserApi(self, expose=expose) + @observe('dataset_items') + def _set_relevant(self, *args): + if len(self.dataset_items) < 1: + self.irrelevant_msg = 'Requires at least one TPF cube to be loaded' + else: + self.irrelevant_msg = '' + @property def marks(self): marks = {} diff --git a/lcviz/plugins/stitch/stitch.py b/lcviz/plugins/stitch/stitch.py index 630ff89..7bc4bd2 100644 --- a/lcviz/plugins/stitch/stitch.py +++ b/lcviz/plugins/stitch/stitch.py @@ -44,6 +44,7 @@ def __init__(self, *args, **kwargs): self.dataset.add_filter(data_not_folded) self.results_label_default = 'stitched' + self._set_relevant() @property def user_api(self): @@ -51,7 +52,7 @@ def user_api(self): return PluginUserApi(self, expose=expose) @observe('dataset_items') - def _set_relevent(self, *args): + def _set_relevant(self, *args): if len(self.dataset_items) < 2: self.irrelevant_msg = 'Requires at least two datasets loaded into viewers' else: