Skip to content
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

DM-22302: Prefer -BEG headers over -OBS headers for datetime_begin #547

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

timj
Copy link
Member

@timj timj commented Jul 30, 2024

No description provided.

@timj timj changed the title DM-22303: Prefer -BEG headers over -OBS headers for datetime_begin DM-22302: Prefer -BEG headers over -OBS headers for datetime_begin Jul 30, 2024
date_key = "MJD-BEG"
date_fmt = "mjd"
for k in ("MJD-BEG", "DATE-BEG", "MJD-OBS", "DATE-OBS"):
if self.is_key_ok(k):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand how this interacts with the default values. If none of these keys exist, it will still try to use MJD-BEG in the return value. Won't that cause a KeyError on L543?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Which will fail the translation. The translation has to blow up anyhow if there aren't any keys available. I was mostly saving myself the trouble of writing my own exception message.

Copy link
Contributor

@czwa czwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, but as the case in question is essentially "what if there is nothing in the header?" I'm not that concerned this will cause problems.

@timj timj merged commit 2f83d41 into main Jul 31, 2024
3 checks passed
@timj timj deleted the tickets/DM-22302 branch July 31, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants