Skip to content

Commit

Permalink
Added methods back but remove all viewer-specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Aug 16, 2024
1 parent 7359dba commit 7c514bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions glue/core/application_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,18 @@ def set_data_color(self, color, alpha):
for data in self.data_collection:
data.style.color = color
data.style.alpha = alpha

def __gluestate__(self, context):
data = self.session.data_collection
from glue.main import _loaded_plugins
return dict(session=context.id(self.session),
data=context.id(data),
plugins=_loaded_plugins)

@classmethod
def __setgluestate__(cls, rec, context):
self = cls(data_collection=context.object(rec['data']))
# manually register the newly-created session, which
# the viewers need
context.register_object(rec['session'], self.session)
return self
2 changes: 1 addition & 1 deletion glue/core/data_factories/astropy_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def astropy_table_read(*args, **kwargs):
# also more generally, we should first try the ASCII readers.
if 'format' not in kwargs:
try:
t = Table.read(*args, format='ascii', **kwargs)
t = Table.read(*args, format='ascii', **kwargs, guess_limit_lines=1000)
# Double-check for certain FITS files that may be read in as ASCII in Python 3.11
if not (len(t) == 1 and [c.value[0] for c in t.itercols()][:3] == ['SIMPLE', '=', 'T']):
return t
Expand Down

0 comments on commit 7c514bb

Please sign in to comment.