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

Don't fail on uncritical nonexisting item #395

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

teutoburg
Copy link
Contributor

This error occurred in AstarVienna/irdb#166 and is fixed by this simple patch. It should be fine (at least for now) to skip any items that cause trouble here...

Copy link

codecov bot commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 74.90%. Comparing base (6057f73) to head (e488076).

Files Patch % Lines
scopesim/effects/fits_headers.py 57.14% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           dev_master     #395      +/-   ##
==============================================
- Coverage       74.92%   74.90%   -0.03%     
==============================================
  Files              56       56              
  Lines            7777     7782       +5     
==============================================
+ Hits             5827     5829       +2     
- Misses           1950     1953       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@teutoburg teutoburg marked this pull request as ready for review April 6, 2024 11:21
Copy link
Collaborator

@hugobuddel hugobuddel left a comment

Choose a reason for hiding this comment

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

Yeah.. I deliberately not added such a try/except block before, because if the value cannot be found, then there is a problem (bug) that should be fixed so I rather have it complain loudly.

I think the proper fix would be to have more fine grained fits keywords yaml files, for example per mode-yaml file. That is, there should be an METIS-ELT-fits-keywords yaml files that defines the keywords that AstarVienna/irdb#166 trips over.

That yaml file should then only be included if the ELT itself is included. The yaml file should be in the METIS irdb package and not in the ELT package, because other ELT instruments might define different headers.

I YAGNI'd that yaml refactoring; that is, I postponed it until we needed it. It seems like a single fits keywords yaml file isn't sufficient anymore with AstarVienna/irdb#166, so I think it would be better to do that refactoring now in the context of that PR instead of postponing it further with this PR. Also, this PR will add "unavailable" to the keyword values, which is wrong.

Nevertheless, I'll let you decide on how to proceed, so I'll approve this workaround.

@teutoburg teutoburg marked this pull request as draft April 12, 2024 11:16
Base automatically changed from dev_master to main April 18, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 Awaiting Review
Development

Successfully merging this pull request may close these issues.

2 participants