-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TST: 9 failures in test_angles.py in devinfra job #16016
Comments
I was able to reproduce this locally, and I think there's actually a simple fix on our side: diff --git a/astropy/coordinates/angles/formats.py b/astropy/coordinates/angles/formats.py
index d772e066b..bcece11dd 100644
--- a/astropy/coordinates/angles/formats.py
+++ b/astropy/coordinates/angles/formats.py
@@ -324,7 +324,7 @@ def _check_hour_range(hrs):
Checks that the given value is in the range (-24, 24).
"""
if np.any(np.abs(hrs) == 24.0):
- warn(IllegalHourWarning(hrs, "Treating as 24 hr"))
+ warn(IllegalHourWarning(str(hrs), "Treating as 24 hr"))
elif np.any(hrs < -24.0) or np.any(hrs > 24.0):
raise IllegalHourError(hrs)
@@ -335,7 +335,7 @@ def _check_minute_range(m):
is equal to 60, then a warning is raised.
"""
if np.any(m == 60.0):
- warn(IllegalMinuteWarning(m, "Treating as 0 min, +1 hr/deg"))
+ warn(IllegalMinuteWarning(str(m), "Treating as 0 min, +1 hr/deg"))
elif np.any(m < -60.0) or np.any(m > 60.0):
# "Error: minutes not in range [-60,60) ({0}).".format(min))
raise IllegalMinuteError(m)
@@ -347,7 +347,7 @@ def _check_second_range(sec):
is equal to 60, then a warning is raised.
"""
if np.any(sec == 60.0):
- warn(IllegalSecondWarning(sec, "Treating as 0 sec, +1 min"))
+ warn(IllegalSecondWarning(str(sec), "Treating as 0 sec, +1 min"))
elif sec is None:
pass
elif np.any(sec < -60.0) or np.any(sec > 60.0): Maybe there's something I missed that makes this patch undesirable, but just in case I'll push a PR now so it's up and ready to merge when you read this ! |
Would have seemed the obvious solution to me, just wondering if one of our warning classes might intercept numbers and convert to |
The weird thing is these warnings are grandchildren of Python built-in |
pytest has started to validate the type of the warning message in pytest-dev/pytest#11804, seems quite obvious (and legitimate) to me. |
The problems were indeed caused by a bug in the development version of |
Coincidentally, weekly cron is running for a recent merge commit into v6.0.x. Let's see if devinfra will be green now. 🤞 https://github.com/astropy/astropy/actions/runs/7936108222 If I don't comment again, means everything is good. If it still fails with the same stuff, I will re-open this issue. If it fails with a different stuff, I will open a new issue. FYI and thanks! xref
UPDATE: devinfra passed! Thanks! |
Probably something changed again in pytest-dev . Just started seeing this today. I restarted a previously passing job on
main
and it fails now: https://github.com/astropy/astropy/actions/runs/7780284592/job/21375925091All failures are similar in nature as this:
Caused by:
Because we have:
astropy/astropy/coordinates/angles/errors.py
Lines 106 to 117 in 102b37c
Reported to:
The text was updated successfully, but these errors were encountered: