You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When iers_degraded_accuracy = error, Astropy reports a warning and not an error (in coordinates) #16128
iers_degraded_accuracy:
Some time conversions like UTC -> UT1 require IERS-A Earth rotation data for full accuracy. In cases where full accuracy is not required and downloading the IERS-A is not possible or desired (for instance running on a cluster) then this option can be set to either 'warn' or 'ignore'. The default is 'error' which will raise an exception if full accuracy is not possible for a time conversion, 'warn' will issue a warning, and 'ignore' will ignore the problem and use available IERS-B data.
Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.
GitHub issues in the Astropy repository are used to track bug reports and feature requests; If your issue poses a question about how to use Astropy, please instead raise your question in the Astropy Discourse user forum and close this issue.
If you feel that this issue has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].
Sorry, indeed my example was wrong. I need to post a more elaborate example, that gives only warning and does not stop. This is the case where internet is not enabled and times are outside of range covered by IERS table.
changed the title [-]When iers_degraded_accuracy = error, Astropy reports a warning and not an error.[/-][+]When iers_degraded_accuracy = error, Astropy reports a warning and not an error (in coordinates)[/+]on Feb 29, 2024
Activity
github-actions commentedon Feb 28, 2024
Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.
GitHub issues in the Astropy repository are used to track bug reports and feature requests; If your issue poses a question about how to use Astropy, please instead raise your question in the Astropy Discourse user forum and close this issue.
If you feel that this issue has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail [email protected].
pllim commentedon Feb 28, 2024
Are you sure that is going to raise anything? I tried your code with latest dev version and there is not even a warning.
We do test for the config behavior here and it seems to work both in CI and locally:
astropy/astropy/utils/iers/tests/test_iers.py
Lines 460 to 463 in ac2427c
IlDordollano commentedon Feb 29, 2024
Sorry, indeed my example was wrong. I need to post a more elaborate example, that gives only warning and does not stop. This is the case where internet is not enabled and times are outside of range covered by IERS table.
Running this example, I receive some warnings, but the execution doesn't stop and doesn't send any error for iers_degraded_accuracy:
pllim commentedon Feb 29, 2024
Thank you very much for the complete example. Turns out the bug is in
coordinates, notutils.iers. The warnings you see are coming from https://github.com/astropy/astropy/blob/main/astropy/coordinates/builtin_frames/utils.py that has custom code to bypass your configs. I am not sure if this is intentional or oversight.For example, in
get_jd12(but not the only place it happens):astropy/astropy/coordinates/builtin_frames/utils.py
Lines 114 to 117 in 73df592
And this is where the "polar motion" one happens and it does not check for config at all:
astropy/astropy/coordinates/builtin_frames/utils.py
Line 49 in 73df592
A quick git blame points to @maxnoe and @taldcroft for some of the designs, so hopefully they can clarify or ping those who can.
[-]When iers_degraded_accuracy = error, Astropy reports a warning and not an error.[/-][+]When iers_degraded_accuracy = error, Astropy reports a warning and not an error (in coordinates)[/+]maxnoe commentedon Feb 29, 2024
I am pretty sure that I didn't touch any code directly related to the warning / error handling there.
Checking the blame, I just slightly changed the wording of the message there
pllim commentedon Feb 29, 2024
I think @eteq is also in the blame somewhere. 😸
Sorry for the noise, @maxnoe !
maxnoe commentedon Feb 29, 2024
@pllim no problem at all, our software also runs in cluster environments so this issue is definitely relevant to us
pllim commentedon Feb 29, 2024
In the meantime, for the affected use case, you would have to catch those warnings yourselves and promote them to error using https://docs.python.org/3/library/warnings.html
IlDordollano commentedon Feb 29, 2024
@pllim nice workaround thanks!