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 <2090236+pllim@users.noreply.github.com>
  • Loading branch information
kecnry and pllim committed Aug 16, 2022
1 parent 3b60b71 commit ff60cd5
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions jdaviz/configs/specviz2d/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,19 @@ def load_data(self, spectrum_2d=None, spectrum_1d=None, spectrum_1d_label=None,
# new defaults. We'll just call it again manually.
spext._trace_dataset_selected()
try:
_ = spext.create_extract(add_data=True)
spext.create_extract(add_data=True)
except Exception:
msg = ("Automatic spectrum extraction failed. See the spectral extraction"
" plugin to perform a custom extraction")
msg = SnackbarMessage(msg, color='error', sender=self, timeout=10000)
msg = SnackbarMessage(
"Automatic spectrum extraction failed. See the spectral extraction"
" plugin to perform a custom extraction",
color='error', sender=self, timeout=10000)
else:
# Warn that this shouldn't be used for science
msg = ("The extracted 1D spectrum was generated automatically."
" See the spectral extraction plugin for details or to"
" perform a custom extraction.")
msg = SnackbarMessage(msg, color='warning', sender=self,
timeout=10000)
msg = SnackbarMessage(
"The extracted 1D spectrum was generated automatically."
" See the spectral extraction plugin for details or to"
" perform a custom extraction.",
color='warning', sender=self, timeout=10000)
self.app.hub.broadcast(msg)

else:
Expand Down

0 comments on commit ff60cd5

Please # to comment.