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
TST: a coordinates test in need to adapt for numpy 2.5 #19133
coordinates.tests.test_representation_method.TestSetShape's entire design revolves around the ability to mutate shape attributes in place, and some assertions can only be satisfied if reshaping one array implicitly modifies other arrays in place, which I don't think we can replicate using only non-deprecated numpy APIs, so there's a need for a discussion here.
I would personally argue that the test case should be modified to reflect a thread-safe usage of numpy arrays (thread safety is the motivation behind the deprecation we're facing), which means eventually dropping support for the exact case that is currently being tested, as it doesn't seem viable to support this in the future if numpy doesn't (and FTR I think their decision is reasonable).
Agreed that numpy's decision is reasonable and that we should just deprecate along with them. Shape setting was/is tricky to get right and it would in fact be nice to get rid of it altogether. Easiest would seem to just let the numpy warnings appear, and adjust the tests to expect them. I.e., I think setting shapes is likely done so infrequently that we do not need to add our own deprecation warnings; yet,given the likely rare use, I don't think we need to move ahead of numpy and remove setting shape earlier (unless elsewhere it becomes a real problem to support it).
changed the title [-]TST: a coordinates test in need to adapt for numpy 1.25[/-][+]TST: a coordinates test in need to adapt for numpy 2.25[/+]on Jan 19, 2026
changed the title [-]TST: a coordinates test in need to adapt for numpy 2.25[/-][+]TST: a coordinates test in need to adapt for numpy 2.5[/+]on Jan 19, 2026
Evidently this isn't posing an immediate issue with CI, but I think the underlying issue might still exist, in that we are still testing, hence, explicitly supporting a use case that is bound to be thread unsafe, so a decision is needed on whether we want to keep supporting it but explicitly document it as unsafe, or fade out support for it at some point.
I'm in favour of deprecating setting shapes - it is a lot of risky, entangled code for a not very useful purpose. As I wrote above, I think it is easiest to just let numpy warnings percolate up, adjusting the test to expect these, and then let things fail if they fail with numpy.
Activity
neutrinoceros commentedon Jan 8, 2026
ping @mhvk as the original author of this test
mhvk commentedon Jan 8, 2026
Agreed that numpy's decision is reasonable and that we should just deprecate along with them. Shape setting was/is tricky to get right and it would in fact be nice to get rid of it altogether. Easiest would seem to just let the numpy warnings appear, and adjust the tests to expect them. I.e., I think setting shapes is likely done so infrequently that we do not need to add our own deprecation warnings; yet,given the likely rare use, I don't think we need to move ahead of numpy and remove setting
shapeearlier (unless elsewhere it becomes a real problem to support it).TST: Wrap deprecated shape setting in warns block (astropy#19133)
[-]TST: a coordinates test in need to adapt for numpy 1.25[/-][+]TST: a coordinates test in need to adapt for numpy 2.25[/+][-]TST: a coordinates test in need to adapt for numpy 2.25[/-][+]TST: a coordinates test in need to adapt for numpy 2.5[/+]pllim commentedon Aug 10, 2026
Is this still an issue?
neutrinoceros commentedon Aug 11, 2026
Evidently this isn't posing an immediate issue with CI, but I think the underlying issue might still exist, in that we are still testing, hence, explicitly supporting a use case that is bound to be thread unsafe, so a decision is needed on whether we want to keep supporting it but explicitly document it as unsafe, or fade out support for it at some point.
mhvk commentedon Aug 11, 2026
I'm in favour of deprecating setting shapes - it is a lot of risky, entangled code for a not very useful purpose. As I wrote above, I think it is easiest to just let numpy warnings percolate up, adjusting the test to expect these, and then let things fail if they fail with numpy.