Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: P. L. Lim <[email protected]>
  • Loading branch information
kecnry and pllim committed May 23, 2022
1 parent ceacc18 commit 95259a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ New Features

- Line list plugin now supports exact-text filtering on line names. [#1298]
- Added a Subset Tools plugin for viewing information about defined subsets. [#1292]
- Data menus in the viewers are filtered to applicable entries only and support removing data from
- Data menus in the viewers are filtered to applicable entries only and support removing generated data from
the app. [#1313]

- Offscreen indication for spectral lines and slice indicator. [#1312]
Expand Down
6 changes: 3 additions & 3 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,6 @@ def vue_data_item_selected(self, event):
self._update_selected_data_items(viewer_id, selected_items)

def vue_data_item_remove(self, event):
"""
"""
self.data_collection.remove(self.data_collection[event['item_name']])

def vue_close_snackbar_message(self, event):
Expand Down Expand Up @@ -1255,11 +1253,13 @@ def _create_data_item(data):
typ = 'cube'
else:
typ = 'unknown'
# we'll expose any information we need here. For "meta", not all entries are guaranteed
# to be serializable, so we'll just send those that we need.
return {
'id': str(uuid.uuid4()),
'name': data.label,
'locked': False,
'ndims': len(data.shape),
'ndims': data.ndim,
'type': typ,
'meta': {k: v for k, v in data.meta.items() if k in ['Plugin', 'mosviz_row']},
'children': []}
Expand Down
10 changes: 4 additions & 6 deletions jdaviz/configs/mosviz/plugins/viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,13 +234,11 @@ def _on_row_selected(self, event):
for data_item in self.jdaviz_app.data_collection:
if data_item.meta.get('Plugin') is not None:
if data_item.meta.get('mosviz_row') == selected_index:
add_data_to_viewer_message = AddDataToViewerMessage(
'spectrum-viewer', data_item.label, sender=self)
self.session.hub.broadcast(add_data_to_viewer_message)
self.session.hub.broadcast(AddDataToViewerMessage(
'spectrum-viewer', data_item.label, sender=self))
else:
remove_data_from_viewer_message = RemoveDataFromViewerMessage(
'spectrum-viewer', data_item.label, sender=self)
self.session.hub.broadcast(remove_data_from_viewer_message)
self.session.hub.broadcast(RemoveDataFromViewerMessage(
'spectrum-viewer', data_item.label, sender=self))

for component in mos_data.components:
comp_data = mos_data.get_component(component).data
Expand Down

0 comments on commit 95259a1

Please sign in to comment.