Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract on SubsetCreateMessage #3238

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
self._extract_in_new_instance(subset_lbl=subset_lbl,
auto_update=True, add_data=True)
except Exception:
raise

Check warning on line 265 in jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py#L265

Added line #L265 was not covered by tests
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is here for debugging to expose the error.

msg = SnackbarMessage(
f"Automatic {self.resulting_product_name} extraction for {subset_lbl} failed", # noqa
color='error', sender=self, timeout=10000)
Expand Down Expand Up @@ -438,9 +439,14 @@
subset_id=aperture.selected, cls=NDDataArray
)
if uncert_cube:
uncertainties = uncert_cube.get_subset_object(
subset_id=aperture.selected, cls=StdDevUncertainty
)
try:

Check warning on line 442 in jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py

View check run for this annotation

Codecov / codecov/patch

jdaviz/configs/cubeviz/plugins/spectral_extraction/spectral_extraction.py#L442

Added line #L442 was not covered by tests
# Subset may not be linked to the uncertainty cube at this point??
uncertainties = uncert_cube.get_subset_object(
subset_id=aperture.selected, cls=StdDevUncertainty
)
except ValueError:
raise
uncertainties = None
else:
uncertainties = None

Expand Down
2 changes: 2 additions & 0 deletions jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1875,6 +1875,8 @@ def __init__(self, plugin, items, selected, multiselect=None, selected_has_subre

self.hub.subscribe(self, SubsetUpdateMessage,
handler=lambda msg: self._update_subset(msg.subset, msg.attribute))
self.hub.subscribe(self, SubsetCreateMessage,
handler=lambda msg: self._update_subset(msg.subset))
Comment on lines +1878 to +1879
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hoped that I could just replace the trigger for this from SubsetUpdateMessage to SubsetCreateMessage, but it didn't work.

self.hub.subscribe(self, SubsetDeleteMessage,
handler=lambda msg: self._delete_subset(msg.subset))

Expand Down
Loading