Repository navigation
BUG: Skip good_enough when auto_max_age is None - #12713
Conversation
|
👋 Thank you for your draft pull request! Do you know that you can use |
mhvk
left a comment
There was a problem hiding this comment.
Thanks for looking into this! A suggestion for a slightly different approach. Obviously, this would also need a test...
Co-authored-by: Marten van Kerkwijk <[email protected]>
8b9a6aa to
e5015fc
Compare
|
These tests failed for me locally but I cannot tell if my local data files are outdated or if it is real. I guess I'll wait for CI to tell me.
|
|
@mhvk , I don't grok why two tests fail with the change you suggested. Any advise on how to proceed? Thanks! |
|
I think I found the mistake. If the first test still fails, it is fine to adjust it -- I think it is an improvement to use the best of the available leap second tables rather than just the first even for |
|
Something still isn't quite right... |
|
I don't understand this test... It expects the algorithm to actually pick the stale one, it seems like. # Between these and the built-in one, the built-in file is best.
ls = iers.LeapSeconds.auto_open([fake_file1, fake_file2,
iers.IERS_LEAP_SECOND_FILE])
assert ls.meta['data_url'] == iers.IERS_LEAP_SECOND_FILE
# ...
# Use the fake files to make sure auto_max_age is safe.
# Should have no warning here.
with iers.conf.set_temp('auto_max_age', None):
ls3 = iers.LeapSeconds.auto_open([fake_file1,
iers.IERS_LEAP_SECOND_FILE])
assert ls3.meta['data_url'] == fake_file1 |
|
I think that test has simple changed because the result is now better. I've pushed the change (and added a bit to it for good measure). |
mhvk
left a comment
There was a problem hiding this comment.
I think this is all OK now!
|
Thanks, @mhvk ! I'll wait a bit to see if this actually helps with @weaverba137 's use case before merge. |
|
OK, while this does eliminate the unnecessary warnings, I am not convinced that @mhvk's approach is correct. Remember, we are working in an HPC environment and must prevent any downloads. We do not want the value of Can you walk me through the logic of this latest approach and demonstrate how this satisfies this requirement? |
weaverba137
left a comment
There was a problem hiding this comment.
As mentioned previously, I think this comes down to knowing exactly how good_enough works in this method.
|
@weaverba137 - |
|
Aha, that makes more sense. Let me take one more look at the full code in that light. |
|
@mhvk, I am satisfied that the changes here will not inadvertently cause a download. However, I don't see the change you made to pick the "best" file over the "first" file. Is that change in this PR? |
|
@weaverba137 - the change in the time is what makes it take the "best" file: before, since |
weaverba137
left a comment
There was a problem hiding this comment.
@mhvk, thank you for your clarifications. I think this is ready to go.
|
Let's just get it in! Thanks, all! Slowly but surely we are making sure astropy rocks on every platform! |
…713-on-v5.0.x Backport PR #12713 on branch v5.0.x (BUG: Skip good_enough when auto_max_age is None)
… change) The 'Time 5167445918.181001' line in the issue log is the observation epoch in seconds since the MJD epoch (1858-11-17), i.e. the standard MS TIME convention, not a corrupt timestamp. The accompanying numpy overflow/invalid RuntimeWarnings were produced by astropy <= 5.0.0: with iers.conf.auto_max_age = None, LeapSeconds.auto_open computed TimeDelta(180 - np.finfo(float).max) which overflowed the split() helper in astropy.time.utils. Fixed upstream in astropy 5.0.1 (astropy/astropy#12713); astropy >= 7.1 is required by this package.
Description
This pull request is to lessen unnecessary warnings when
iers.conf.auto_max_ageisNone.Fixes #12708
TODO
Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
Extra CIlabel.no-changelog-entry-neededlabel. If this is a manual backport, use theskip-changelog-checkslabel unless special changelog handling is necessary.astropy-botcheck might be missing; do not let the green checkmark fool you.backport-X.Y.xlabel(s) before merge.