Skip to content

Commit

Permalink
BUG: Fix Import Data button
Browse files Browse the repository at this point in the history
and update change log.
  • Loading branch information
pllim committed Sep 29, 2022
1 parent 574a7af commit 8c16675
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ Specviz
Bug Fixes
---------

- Fixed loading data via the Import Data button on top-left of the application.
[#1608]

Cubeviz
^^^^^^^

Expand Down Expand Up @@ -110,7 +113,7 @@ Specviz2d
- Fixed default spectral extraction parameters when the background separation otherwise would have
fallen directly on the edge of the image. [#1633]

- Fix parser for Level 2 NIRSpec ``s2d`` files. [#1608]
- Fixed parser for Level 2 NIRSpec ``s2d`` files. [#1608]

Other Changes and Additions
---------------------------
Expand Down
10 changes: 2 additions & 8 deletions jdaviz/configs/default/plugins/data_tools/data_tools.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from jdaviz.core.template_mixin import TemplateMixin
from jdaviz.core.events import LoadDataMessage
from traitlets import Unicode, Bool
import os
from jdaviz.configs.default.plugins.data_tools.file_chooser import FileChooser
Expand Down Expand Up @@ -41,14 +40,9 @@ def vue_load_data(self, *args, **kwargs):
self.error_message = "No file selected"
elif os.path.exists(self._file_upload.file_path):
try:
load_data_message = LoadDataMessage(self._file_upload.file_path, sender=self)
self.hub.broadcast(load_data_message)
# NOTE: Helper loader does more stuff than native Application loader.
self.app._jdaviz_helper.load_data(self._file_upload.file_path)
except Exception as err:
self.error_message = f"An error occurred when loading the file: {repr(err)}"
else:
self.dialog = False

if self.config == 'imviz':
# Do this like what Imviz does at the end of loading sequence from helper.
from jdaviz.configs.imviz.helper import link_image_data
link_image_data(self._app, link_type='pixels', error_on_fail=False)

0 comments on commit 8c16675

Please sign in to comment.