Skip to content

Commit

Permalink
cleanup print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Mar 19, 2024
1 parent 3815c55 commit 7014ea7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,24 +368,22 @@ def __init__(self, configuration=None, *args, **kwargs):

def _update_live_plugin_results(self, trigger_data_lbl=None, trigger_subset=None):
trigger_subset_lbl = trigger_subset.label if trigger_subset is not None else None
trigger_subset_hash = hash(trigger_subset) if trigger_subset is not None else None
for data in self.data_collection:
plugin_inputs = data.meta.get('_update_live_plugin_results', None)
if plugin_inputs is None:
continue
data_subs = plugin_inputs.get('_subscriptions', {}).get('data', [])
subset_subs = plugin_inputs.get('_subscriptions', {}).get('subset', [])
print(f"*** {data.label}: {trigger_data_lbl} {data_subs} {[plugin_inputs.get(attr) == trigger_data_lbl for attr in data_subs]}, {trigger_subset_lbl} {subset_subs} {[plugin_inputs.get(attr) == trigger_subset_lbl for attr in subset_subs]}")
if (trigger_data_lbl is not None and
not np.any([plugin_inputs.get(attr) == trigger_data_lbl for attr in data_subs])):
not np.any([plugin_inputs.get(attr) == trigger_data_lbl
for attr in data_subs])):
continue
if (trigger_subset_lbl is not None and
not np.any([plugin_inputs.get(attr) == trigger_subset_lbl for attr in subset_subs])):
not np.any([plugin_inputs.get(attr) == trigger_subset_lbl
for attr in subset_subs])):
continue
# update and overwrite data
print("*** UPDATING LIVE PLUGIN RESULTS FOR", data.label, trigger_subset_hash)
# make a new instance of the plugin to avoid changing any UI settings
print("*** PLUGIN", data.meta.get('Plugin'))
plg = self._jdaviz_helper.plugins.get(data.meta.get('Plugin'))._obj.new()
if not plg.supports_auto_update:
raise NotImplementedError(f"{data.meta.get('Plugin')} does not support live-updates") # noqa
Expand Down
2 changes: 1 addition & 1 deletion jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3355,7 +3355,7 @@ def __init__(self, plugin, label, label_default, label_auto,
self.add_observe(label, self._on_label_changed)

def __repr__(self):
return f"<AddResults label='{self.label}', auto={self.auto}, viewer={self.viewer.selected}, auto_update_result={self.auto_update_result}>"
return f"<AddResults label='{self.label}', auto={self.auto}, viewer={self.viewer.selected}, auto_update_result={self.auto_update_result}>" # noqa

@property
def user_api(self):
Expand Down

0 comments on commit 7014ea7

Please sign in to comment.