Update ERFA leap seconds using new IERS LeapSecond class.#9365
Update ERFA leap seconds using new IERS LeapSecond class.#9365eteq merged 21 commits intoastropy:masterfrom
Conversation
|
Hmm, clearly cannot assume that CI machines have up-to-date leap-second files in their virtual machines... |
f69eaeb to
7dce483
Compare
|
@bsipocz - is there any way to restart circle-ci jobs? (They failed due to connectivity problems.) Or should I just close/reopen? |
yes, log into circleCI and there should be a dropdown somewhere top right with a "Rerun job with SSH" option. |
|
or in the workflows menu, there is a "rerun from failed" one. |
|
(but then these connection related failures seem to be around all morning, seen the same on numpy an hour or so ago). |
|
Ah, logging in and out of circle-ci made that option possible (previously it said I had no write access). THanks! |
|
Oops, didn't mean to start all circle-ci jobs again... |
|
(circleCI failure is due to this: https://status.docker.com/) |
eteq
left a comment
There was a problem hiding this comment.
A few in-line suggestions and some bigger ones here. I'll aim to do another review later when we have #9329 in after you've rebased.
- I'm not convinced this belongs in
astropy.utils.iers. I think users may want to do updates of leap seconds using this table even independent of IERS. So perhaps it should instead either go inastropy.utilsor evenastropy.time? - We should add some narrative docs about this, although that could be a follow-on PR since it isn't feature-freeze critical. (I'm also adding the what's new tag to this because I think it's worth highlighting as long as we have the docs for it).
- I know this was discussed in #9334 so maybe I missed something in that thread, but... It looks to me like the reason to use the leap second files is because the historical data are needed. Can't we use the current IERS files plus the builtin file to get the latest leap second? That will be wrong if there's multiple intervening leap seconds, but maybe the user doesn't care that much?
astropy/utils/iers/iers.py
Outdated
| The table should hold columns 'year', 'month', 'tai_utc'. | ||
|
|
||
| Methods are provided to initialize the table from IERS ``Leap_Second.dat``, | ||
| IETF/ntp ``leap-seconds.list``, or built-in ERFA/SOFA. |
There was a problem hiding this comment.
The seems like a likely gotcha for potential users...
| IETF/ntp ``leap-seconds.list``, or built-in ERFA/SOFA. | |
| IETF/ntp ``leap-seconds.list``, or built-in ERFA/SOFA. Note that to | |
| actually update the leap seconds used by ``astropy``, the | |
| `update_erfa_leap_seconds` method must be explicitly called. |
There was a problem hiding this comment.
I suppose update_erfa_leap_seconds needs double backticks or full API path.
There was a problem hiding this comment.
Done a bit differently, without an explicit name. Could rewrite this part to enumerate all class methods, but that seemed excessive.
|
@eteq - on the larger picture: the leap seconds are for a number of time formats including the bog-standard As for the location: since IERS is the organisation responsible for leap seconds, I think it does belong in an iers module (though it could be outside of |
eb43147 to
e41c891
Compare
|
@eteq - about being part of |
|
@eteq - per your request, I now also allow full override of the built-in erfa table, by another special string for I think this is done apart from your wish for more documentation. For that, I'm not so sure there is a real need - this is the kind of thing almost nobody will ever need, and, if they need it, they better look at the code anyway. |
|
I don't see any logical explanation of the travis test failures. Locally I don't see those test collection errors, so will just restart the travis job for now. |
b22eed0 to
93700d5
Compare
93700d5 to
87226dc
Compare
|
@eteq - do you want to have a last look? See #9365 (comment) for an overview of the changes (mostly location, code very similar). |
|
@mhvk - I have a few remaining quibbles but since it's definitely better to get this in even without my quibbles addressed than not at off (and we're really in the cutoff time...) I think it's better to merge these and I can put my quibbles in a separate PR. So merging now! |
|
In a clean build of master right now I'm seeing this: ??? |
|
Darn!! There I thought I had finally solved the import order problems. New issue at #9490 (any suggestions most welcome... |
|
Given that we've upgraded the bundled erfa to be a released version, the second changelog entry here is not needed any longer, so I removed in for the release (but kept the first part). |
|
Sure, thanks! |
A separate follow-up on #9329, which uses a new
astropy.utils.iers.LeapSecondclass to update the ERFA leap seconds. Here, updates are either gotten from IERS or from IETF.cc also @aarchiba, whose comments made clear that my previous attempt, which used the IERS tables, was just not going to work (see #9334).