Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions astrodata/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from .utils import (
assign_only_single_slice,
astro_data_descriptor,
deprecated,
normalize_indices,
returns_list,
)
Expand Down Expand Up @@ -431,17 +430,8 @@ def hdr(self):
return headers[0] if self.is_single else FitsHeaderCollection(headers)

@property
@deprecated(
"Access to headers through this property is deprecated and "
"will be removed in the future. Use '.hdr' instead."
)
def header(self):
"""Return the headers for the PHU and each extension.

.. warning::

This property is deprecated and will be removed in the future.
"""
"""Return the headers for the PHU and each extension."""
return [self.phu] + [ndd.meta["header"] for ndd in self._nddata]

@property
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/test_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ def test_open(example_fits_file):
astrodata.open(example_fits_file)


def test_deprecated_astrodata_header(ad):
with pytest.warns(AstroDataDeprecationWarning):
ad.header


def test_deprecated_astrodatafactory_openFile(example_fits_file):
with pytest.warns(AstroDataDeprecationWarning):
astrodata.factory._openFile(example_fits_file)
Expand Down
13 changes: 6 additions & 7 deletions tests/unit/test_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,18 +754,17 @@ def test_header_collection(GMOSN_SPECT):

@skip_if_download_none
@pytest.mark.dragons_remote_data
def test_header_deprecated(GMOSN_SPECT):
def test_header(GMOSN_SPECT):
ad = astrodata.from_file(GMOSN_SPECT)
with pytest.warns(AstroDataDeprecationWarning):
warnings.simplefilter("always", AstroDataDeprecationWarning)
header = ad.header

header = ad.header

assert header[0]["ORIGNAME"] == "N20170529S0168.fits"
assert header[1]["EXTNAME"] == "SCI"
assert header[1]["EXTVER"] == 1

with pytest.warns(AstroDataDeprecationWarning):
warnings.simplefilter("always", AstroDataDeprecationWarning)
header = ad[0].header
header = ad.header

assert header[0]["ORIGNAME"] == "N20170529S0168.fits"


Expand Down
Loading