Skip to content

Commit

Permalink
Document that headers from YAML files should be accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Mar 23, 2021
1 parent cfd962d commit 60725f3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/astro_metadata_translator/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,11 @@ def determine_translatable_headers(cls, filename, primary=None):
`determine_translator()` on the result to work out which translator
class to then call to obtain the real headers to be used for
translation.
If a primary header is given but is associated with a file in a format
that is not understood, the primary header is returned and no
attempt made to read the file. This situation is commonly encountered
with translator test data stored in JSON or YAML format.
"""
if primary is not None:
yield primary
Expand Down
5 changes: 5 additions & 0 deletions python/astro_metadata_translator/translators/decam.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@ def determine_translatable_headers(cls, filename, primary=None):
`determine_translator()` on the result to work out which translator
class to then call to obtain the real headers to be used for
translation.
If a primary header is given but is associated with a file in a format
that is not understood, the primary header is returned and no
attempt made to read the file. This situation is commonly encountered
with translator test data stored in JSON or YAML format.
"""
# Circular dependency so must defer import
from ..headers import merge_headers
Expand Down
5 changes: 5 additions & 0 deletions python/astro_metadata_translator/translators/megaprime.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ def determine_translatable_headers(cls, filename, primary=None):
`determine_translator()` on the result to work out which translator
class to then call to obtain the real headers to be used for
translation.
If a primary header is given but is associated with a file in a format
that is not understood, the primary header is returned and no
attempt made to read the file. This situation is commonly encountered
with translator test data stored in JSON or YAML format.
"""

# If this is not a FITS file return the primary if defined.
Expand Down

0 comments on commit 60725f3

Please sign in to comment.