Skip to content

Commit

Permalink
irrelevant if no TPF data
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Jun 5, 2024
1 parent 5f8a65e commit c8d2496
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,21 @@ 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):
expose = ['show_live_preview', 'dataset',
'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 = {}
Expand Down
3 changes: 2 additions & 1 deletion lcviz/plugins/stitch/stitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ 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):
expose = ['dataset', 'stitch', 'remove_input_datasets', 'add_results']
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:
Expand Down

0 comments on commit c8d2496

Please sign in to comment.