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

Ignore the bounding box ordering warning when reading files #526

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

WilliamJamieson
Copy link
Collaborator

Old files in the MAST archive have ambiguous encodings for the bounding box which triggers this warning spuriously. Thus this warning should be ignored for written files. The warning exists for dynamically created WCS objects such as those created during a unit test, not those arising from file reads.

This is a compromise that @pllim convinced me would be necessary to avoid user complaints when using GWCS originating form older files they got from MAST.

@WilliamJamieson WilliamJamieson force-pushed the bugfix/ignore_warnings_from_existing_files branch from 976dafd to 2a1fc83 Compare November 14, 2024 16:11
@WilliamJamieson
Copy link
Collaborator Author

@pllim can you confirm this prevents the warnings from files you found in your test suites?

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.46%. Comparing base (9cd8552) to head (a79d1be).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #526      +/-   ##
==========================================
+ Coverage   87.42%   87.46%   +0.03%     
==========================================
  Files          22       22              
  Lines        3874     3886      +12     
==========================================
+ Hits         3387     3399      +12     
  Misses        487      487              

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


🚨 Try these New Features:

pllim added a commit to pllim/jdaviz that referenced this pull request Nov 14, 2024
pllim added a commit to pllim/jdaviz that referenced this pull request Nov 14, 2024
pllim added a commit to pllim/specutils that referenced this pull request Nov 14, 2024
@pllim
Copy link
Contributor

pllim commented Nov 14, 2024

@pllim
Copy link
Contributor

pllim commented Nov 14, 2024

Somehow this broke gwcs/converters/tests/test_wcs.py::test_references ?


# Check that no warning is issued for the bounding box of this WCS object
with warnings.catch_warnings():
warnings.simplefilter("error")
Copy link
Contributor

Choose a reason for hiding this comment

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

This filter is probably unnecessary if you already turn all warnings in pytest into exception but probably also does not hurt.

Copy link
Contributor

@pllim pllim Nov 14, 2024

Choose a reason for hiding this comment

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

OK nvm... looks like you are not doing that. #527

gwcs/pyproject.toml

Lines 87 to 90 in 7f92615

filterwarnings = [
"ignore:Models in math_functions:astropy.utils.exceptions.AstropyUserWarning",
"ignore:numpy.ndarray size changed:RuntimeWarning",
]

@pllim

This comment was marked as resolved.

@WilliamJamieson WilliamJamieson force-pushed the bugfix/ignore_warnings_from_existing_files branch from 510b4fb to 3361532 Compare November 14, 2024 18:28
Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

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

Downstream PRs are happy. Thanks!

@WilliamJamieson WilliamJamieson force-pushed the bugfix/ignore_warnings_from_existing_files branch from 3361532 to b8e242c Compare November 15, 2024 15:33
@WilliamJamieson WilliamJamieson marked this pull request as ready for review November 15, 2024 15:33
@WilliamJamieson WilliamJamieson requested a review from a team as a code owner November 15, 2024 15:33
@pllim
Copy link
Contributor

pllim commented Nov 18, 2024

Any reason why this still unmerged? Once this is merged, I can undo the downstream hackeries. Thanks!

Old files in the MAST archive have ambiguous encodings for the bounding box which triggers this warning spuriously. Thus this warning should be ignored for written files. The warning exists for dynamically created WCS objects such as those created during a unit test, not those arising from file reads.
@WilliamJamieson WilliamJamieson force-pushed the bugfix/ignore_warnings_from_existing_files branch from b8e242c to a79d1be Compare November 20, 2024 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants