-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve format identification #719
Conversation
6fbef61
to
d10e948
Compare
except AttributeError: | ||
return 0 | ||
|
||
return [self.item(f, f.label, f.identifier, get_priority(f)) for f in __factories__] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when is priority not defined in a namedtuple?
@ChrisBeaumont - I have implemented your suggestions. In a separate pull request, I can change all the internal data loaders to use the Does this seem ok now? |
19efe72
to
556e31a
Compare
…n-numerical datasets.
… e.g. FITS/HDF5 loaders to take precedence over the more generic ones.
…e controlled with priorities)
… priority order (then alphabetical label order), and stop iterating once we have a good match and the priority has decreased.
170590e
to
c144281
Compare
+1 |
Improve format identification
@ChrisBeaumont - thanks for reviewing! |
At the moment, glue uses a default factory based on filename in order to open files. This can lead to issues in cases where readers define more specialized versions of common formats. For instance, the astrodendro package stores dendrograms in FITS and HDF5 files, but there is already a general FITS and HDF5 reader (which is also the default factory for any file whose name ends in
hdf5
orfits
).This PR makes the following changes:
With these changes, one can do for example
glue dendro.fits
and it will correctly open up as a dendrogram dataset.There are failing tests, so this is still a WIP, but @ChrisBeaumont let me know if you have any thoughts in the mean time about this approach.