Skip to content

Commit

Permalink
Register the ASDF HDU with astropy as early as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
drdavella committed Dec 15, 2017
1 parent 0022c16 commit 24b0865
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 8 additions & 0 deletions asdf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,12 @@
class ValidationError(ValidationError):
pass

try:
from astropy.io import fits
except ImportError:
pass
else:
from .fits_embed import _AsdfHDU
fits.register_hdu(_AsdfHDU)

open = AsdfFile.open
3 changes: 0 additions & 3 deletions asdf/fits_embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ def _summary(self):
return (self.name, self.ver, self.__class__.__name__, len(self._header))


fits.register_hdu(_AsdfHDU)


class _FitsBlock(object):
def __init__(self, hdu):
self._hdu = hdu
Expand Down

0 comments on commit 24b0865

Please sign in to comment.