Skip to content
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: numpy 2.0 float repr incompatibility in tests #464

Closed
bsipocz opened this issue Jul 26, 2023 · 5 comments · Fixed by #465
Closed

TST: numpy 2.0 float repr incompatibility in tests #464

bsipocz opened this issue Jul 26, 2023 · 5 comments · Fixed by #465

Comments

@bsipocz
Copy link
Member

bsipocz commented Jul 26, 2023

I lost track of the discussion, so cc-ing @pllim and @seberg to ask what we ended up deciding about these? Should we handle it in the doctestplus level?

One example here:

 __________________ TestSpatialConstraint.test_SkyCoord_Circle __________________

self = <pyvo.registry.tests.test_rtcons.TestSpatialConstraint object at 0x7f1baf9ca9d0>

    def test_SkyCoord_Circle(self):
        cons = registry.Spatial((SkyCoord(3 * u.deg, -30 * u.deg), 3))
>       assert cons.get_search_condition() == "1 = CONTAINS(MOC(6, CIRCLE(3.0, -30.0, 3)), coverage)"
E       AssertionError: assert '1 = CONTAINS...)), coverage)' == '1 = CONTAINS...)), coverage)'
E         - 1 = CONTAINS(MOC(6, CIRCLE(3.0, -30.0, 3)), coverage)
E         + 1 = CONTAINS(MOC(6, CIRCLE(np.float64(3.0), np.float64(-30.0), 3)), coverage)
E         ?                            +++++++++++   +  +++++++++++     +

pyvo/registry/tests/test_rtcons.py:226: AssertionError
@pllim
Copy link
Member

pllim commented Jul 26, 2023

Is this with numpy dev or stable? There were a slew of changes we had to adapt to and then there is one that just got merged yesterday that I haven't seen in devdeps yet.

@pllim
Copy link
Member

pllim commented Jul 26, 2023

Oh, wait. I jinxed it. It starts popping up now... 400+ failures: https://github.com/astropy/astropy/actions/runs/5671453922/job/15368606312

So, I have no solution for you yet but I think @mhvk was going to open a PR in astropy for that?

EDIT:

@seberg
Copy link

seberg commented Jul 26, 2023

With dev, there is a np.set_printoptions(legacy="1.25"), which should be a hot-fix.

@pllim
Copy link
Member

pllim commented Jul 26, 2023

Hmm weird, set_printoptions did not catch everything. I still get 10 failures or so over at https://github.com/astropy/astropy/actions/runs/5672129013/job/15370729506?pr=15096 (astropy/astropy#15096)

p.s. TRFLSQFitter warnings in the log are unrelated.

@bsipocz
Copy link
Member Author

bsipocz commented Jul 26, 2023

I see one similar to those in astroquery involving a VOTable. I haven't looked at it closely yet though as the fires here are a bit bigger :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants