Apply iers_degraded_accuracy to stale IERS_Auto predictive values - #20256
Conversation
IERS_Auto always raised a ValueError when the co-installed IERS-A data was older than auto_max_age and a conversion needed predictive values, regardless of iers_degraded_accuracy. This regressed from IERS-B-only behavior where 'warn'/'ignore' were honored. Now IERS_Auto._check_interpolate_indices behaves like IERS does for out-of-range times: the default 'error' still raises ValueError, 'warn' emits IERSDegradedAccuracyWarning, and 'ignore' is silent. This matches the maintainer-invited fix requested in issue astropy#19823. Tests: 2 new TestIERS_Auto cases for 'warn' and 'ignore'; all 29 IERS suite tests and 5 time/ut1 tests pass.
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
mhvk
left a comment
There was a problem hiding this comment.
@CAOShurong - Thanks, this looks good! Let me start CI.
mhvk
left a comment
There was a problem hiding this comment.
OK, tests passed, so let's get this in. Thanks again, @CAOShurong!
|
p.s. Am keeping milestone as is, since while I consider it a bug, it is also a kind of API change. |
|
Hmm, somehow the earlier tests passed, but now that I changed the label to |
…r 19823 The towncrier check requires the changelog fragment filename to match the PR number, not the linked issue number.
|
Renamed the changelog fragment from \19823.bugfix.rst\ to \20256.bugfix.rst\ to use the PR number as expected by towncrier. |
|
Small correction to my earlier note: the changelog fragment was renamed from |
|
Thanks again, @CAOShurong - I've now merged. |
|
O, shoot, I should have looked better at the devdeps failure, that is actually real, due to this PR! I've made a quick fix myself at #20262. |
- manifest: add astropy/astropy#20256 (scientific track), now 20 entries - README: merged-entry + updated totals paragraph - tests: snapshot shape 19/10/9 -> 20/11/10 - svg regenerated deterministically
TST,BUG: test adjustment forgotten in gh-20256
Fixes #19823
Problem
When IERS-A data is co-installed via astropy-iers-data (default in current versions), the
IERS_Autoclass always raised aValueErrorwhen a conversion needed predictive values that were more thanauto_max_agedays old, even when the user setiers.conf.iers_degraded_accuracy = "warn". With IERS-B only, the same setting yields anIERSDegradedAccuracyWarning.From the issue, this is a regression from astropy 5.3.3 behavior and was confirmed as a bug by maintainer @mhvk, who invited a PR to apply
iers_degraded_accuracyto co-installed data.Change
IERS_Auto._check_interpolate_indicesnow honorsiers_degraded_accuracyfor stale predictive values, matching howIERStreats out-of-range times:"error"(default): raisesValueError(INTERPOLATE_ERROR) as before"warn": emitsIERSDegradedAccuracyWarning"ignore": silentThe config item and docs no longer say the setting applies only to IERS-B.
Tests
test_iers_degraded_accuracy_warn: warns instead of raisingtest_iers_degraded_accuracy_ignore: runs silentlytest_iers.pytests and 5time/tests/test_ut1.pytests pass.