Skip to content

Commit

Permalink
fix rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Mar 29, 2024
1 parent ecd475e commit d2035db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2585,6 +2585,10 @@ def compose_viewer_area(viewer_area_items):

tray_item_instance = tray.get('cls')(app=self)

# store a copy of the tray name in the instance so it can be accessed by the
# plugin itself
tray_item_label = tray.get('label')

# NOTE: is_relevant is later updated by observing irrelevant_msg traitlet
self.state.tray_items.append({
'name': name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
from astropy import units as u
from specutils import Spectrum1D

from jdaviz.configs.default.plugins.collapse.collapse import Collapse


@pytest.mark.filterwarnings('ignore')
def test_linking_after_collapse(cubeviz_helper, spectral_cube_wcs):
cubeviz_helper.load_data(Spectrum1D(flux=np.ones((3, 4, 5)) * u.nJy, wcs=spectral_cube_wcs))
dc = cubeviz_helper.app.data_collection

coll = Collapse(app=cubeviz_helper.app)
# TODO: this now fails when instantiating Collapse after initialization
coll = cubeviz_helper.plugins['Collapse']._obj

coll.selected_data_item = 'Unknown spectrum object[FLUX]'
coll.dataset_selected = 'Unknown spectrum object[FLUX]'
Expand Down
5 changes: 4 additions & 1 deletion jdaviz/core/template_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def __init__(self, app, **kwargs):
# get default viewer names from the helper, according to the requirements of the plugin
for registry_name, tray_item in tray_registry.members.items():
if tray_item['cls'] == self.__class__:
self._plugin_name = tray_item['label']
# If viewer reference names need to be passed to the tray item
# constructor, pass the names into the constructor in the format
# that the tray items expect.
Expand Down Expand Up @@ -3180,6 +3181,8 @@ def not_from_plugin(data):
return data.meta.get('Plugin', None) is None

def not_from_this_plugin(data):
if self.plugin._plugin_name is None:
return True
return data.meta.get('Plugin', None) != self.plugin._plugin_name

def not_from_plugin_model_fitting(data):
Expand Down Expand Up @@ -3616,7 +3619,7 @@ def add_results_from_plugin(self, data_item, replace=None, label=None):
if self.app.config == 'mosviz':
data_item.meta['mosviz_row'] = self.app.state.settings['mosviz_row']

if self.auto_update_result:
if getattr(self, 'auto_update_result', False):
data_item.meta['_update_live_plugin_results'] = self.plugin.user_api.to_dict()
def_subs = {'data': ('dataset',),
'subset': ('spectral_subset', 'spatial_subset', 'subset', 'aperture')}
Expand Down

0 comments on commit d2035db

Please sign in to comment.