diff --git a/glue/config.py b/glue/config.py index 0c970e642..d12b55dce 100644 --- a/glue/config.py +++ b/glue/config.py @@ -390,7 +390,7 @@ def __getitem__(self, cmap_name): def name_from_cmap(self, cmap_desired): for name, cmap in self.members: - if cmap is cmap_desired: + if cmap is cmap_desired or cmap.name == cmap_desired.name: return name raise ValueError("Could not find name for colormap") diff --git a/glue/core/application_base.py b/glue/core/application_base.py index b200f87c0..0d286e955 100644 --- a/glue/core/application_base.py +++ b/glue/core/application_base.py @@ -352,11 +352,11 @@ def set_data_color(self, color, alpha): data.style.alpha = alpha def __gluestate__(self, context): - viewers = [list(map(context.id, tab)) for tab in self.viewers] data = self.session.data_collection from glue.main import _loaded_plugins - return dict(session=context.id(self.session), viewers=viewers, - data=context.id(data), plugins=_loaded_plugins) + return dict(session=context.id(self.session), + data=context.id(data), + plugins=_loaded_plugins) @classmethod def __setgluestate__(cls, rec, context): @@ -364,10 +364,4 @@ def __setgluestate__(cls, rec, context): # manually register the newly-created session, which # the viewers need context.register_object(rec['session'], self.session) - for i, tab in enumerate(rec['viewers']): - if self.tab(i) is None: - self.new_tab() - for v in tab: - viewer = context.object(v) - self.add_widget(viewer, tab=i, hold_position=True) return self