pyuvdata icon indicating copy to clipboard operation
pyuvdata copied to clipboard

feat: ignore_telescope_param_update_warnings_for

Open steven-murray opened this issue 1 year ago • 1 comments
trafficstars

Description

This adds two functions -- ignore_telescope_param_update_warnings_for and unignore_telescope_param_update_warnings_for, which enable warnings for updates from a given telescope to be globally ignored.

Motivation and Context

There are many many warnings emanating from hera_cal tests because old HERA files used in the tests don't have metadata like antenna_diameters (and frankly for the tests we don't care). Lately these have raised warnings. While raising the warnings makes sense in general, often for specific telescopes it doesn't, since we can know ahead of time that the data provided by the pyuvdata KNOWN_TELESCOPES is good.

While we could silence the warnings in our tests by finding every call to .read() and using the pytest.warns() context manager, this becomes pretty annoying as there are MANY instances, and it adds noise to the code. This solution would allow us to call one function in the conftest.

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Documentation change (documentation changes only)
  • [ ] Version change
  • [ ] Build or continuous integration change

Checklist:

  • [x] I have read the contribution guide.
  • [x] My code follows the code style of this project.

New feature checklist:

  • [x] I have added or updated the docstrings associated with my feature using the numpy docstring format.
  • [ ] I have updated the tutorial to highlight my new feature (if appropriate).
  • [ ] I have added tests to cover my new feature.
  • [x] All new and existing tests pass.
  • [x] I have updated the CHANGELOG.

steven-murray avatar Jul 08 '24 05:07 steven-murray

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.92%. Comparing base (adfcb8c) to head (99f5ecd). Report is 91 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1459   +/-   ##
=======================================
  Coverage   99.92%   99.92%           
=======================================
  Files          61       61           
  Lines       21371    21380    +9     
=======================================
+ Hits        21356    21365    +9     
  Misses         15       15           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 08 '24 05:07 codecov[bot]