Repository navigation
Make sure we re-download the IERS table if the URL has changed. - #5072
Conversation
70da7d0 to
cdf05e0
Compare
|
(This is not really critical but I'm marking it as such to make sure I include it in the 1.2 RC) |
|
I've also opened a PR for a simpler alternative: #5074 |
|
Thanks @astrofrog. I had arrived at the same conclusion just minutes before seeing your notification. I remember when developing this that I had thought about checking the URL for a change and decided not to, but thinking now it seems like a good plan. This would have saved a lot of headache... I like this over #5074, since it seems like that one will re-read the table every time you do an |
|
In particular I think that #5074 will re-read the cached file (slow) each time you do a UT1 transform. |
|
@taldcroft - ok, that sounds good. Feel free to merge this one once you are happy with it and close #5074. Once one of them is merged, I'll cut the 1.2rc1. |
|
The URL is already stored, so I think you can just test for |
|
Otherwise 👍. |
244ca76 to
57ff2b0
Compare
Make sure we re-download the IERS table if the URL has changed.
This is the solution to the issues reported in #5051 (took a few hours to figure out...). I'm surprised you didn't see the issue when running the tests (I don't see how they could pass before this PR).
The issue is that tests run before
astropy.utils.ierscause the IERS file to be downloaded, which setsIERS_Auto.iers_table. When you then later change the URL to a local file intest_iers.py, it did not try and get the local file becausecls.iers_table is not Noneand it was then using the real downloaded file instead of the local file. This also explains why the test did not fail when running just the IERS tests. With this PR, if the URL has changed, the file is retrieved again.Another solution would be to simply not cache
.iers_tableand rely only on thedownload_filecaching mechanism.@taldcroft - can you review this and let me know what you think?
cc @pllim