Skip to content

Suppress expected jwst_gtvt future-date ERFA warnings locally - #718

Open
taylorbell57 wants to merge 2 commits into
mainfrom
suppress-gtvt-erfa-warning
Open

taylorbell57 wants to merge 2 commits into
mainfrom
suppress-gtvt-erfa-warning

Conversation

@taylorbell57

Copy link
Copy Markdown
Contributor

Closes #716

jwst_gtvt validates its internal future maximum date while constructing an ephemeris, producing an ERFA dubious year warning even when the requested visibility period is earlier.

This change suppresses only that expected warning, only during ephemeris construction. A regression test verifies that unrelated ERFA warnings remain visible.

Tests: pytest exoctk/tests/test_contam_visibility.py -q -k 'new_vis_plot or visibility_ephemeris_suppresses'

@taylorbell57 taylorbell57 added 3: LOW PRIORITY Tool: contam_visibility python Pull requests that update Python code labels Jul 17, 2026
@taylorbell57
taylorbell57 force-pushed the suppress-gtvt-erfa-warning branch 2 times, most recently from 835bdc9 to 66482dc Compare July 20, 2026 21:31
@taylorbell57
taylorbell57 force-pushed the suppress-gtvt-erfa-warning branch from 66482dc to 8fadd1d Compare August 4, 2026 01:35
@taylorbell57
taylorbell57 requested a review from Copilot August 4, 2026 01:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses noisy ERFA dubious year warnings emitted during jwst_gtvt ephemeris construction by adding a narrowly scoped warning suppression around BoundedEphemeris() construction, plus a regression test ensuring unrelated ERFA warnings are still surfaced to callers.

Changes:

  • Locally suppress the specific ERFA dtf2d “dubious year (Note 6)” warning only during BoundedEphemeris construction.
  • Add a regression test that verifies the expected warning is suppressed while unrelated ErfaWarnings remain visible.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
exoctk/contam_visibility/new_vis_plot.py Adds a tightly scoped warnings filter around ephemeris construction to ignore only the expected ERFA “dubious year” warning.
exoctk/tests/test_contam_visibility.py Adds a regression test to ensure only the expected ERFA warning is suppressed and unrelated ERFA warnings still propagate.
Suppressed comments (1)

exoctk/tests/test_contam_visibility.py:249

  • After restricting the capture to ErfaWarning, the assertion can be simplified; using w.message also avoids relying on the local variable name warning and keeps the expression concise.
    assert [str(warning.message) for warning in caught] == [
        'unrelated ERFA warning']

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread exoctk/tests/test_contam_visibility.py
Comment thread exoctk/contam_visibility/new_vis_plot.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@taylorbell57
taylorbell57 force-pushed the suppress-gtvt-erfa-warning branch from 0a16788 to 4fea80d Compare August 4, 2026 15:49
Limit the ERFA dubious-year suppression to Ephemeris construction, where jwst_gtvt validates its internal maximum date. Add a regression test confirming unrelated ERFA warnings are still emitted.
@taylorbell57
taylorbell57 force-pushed the suppress-gtvt-erfa-warning branch from 4fea80d to bf26859 Compare October 1, 2026 21:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3: LOW PRIORITY python Pull requests that update Python code Tool: contam_visibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress expected jwst_gtvt future-date ERFA warnings locally

2 participants