Skip to content

TST: numpy 2.0 float repr incompatibility in tests #464

Closed

Description

@bsipocz

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

Activity

  1. pllim commented on Jul 26, 2023

    @pllim
    Member

    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.

  2. pllim commented on Jul 26, 2023

    @pllim
    Member
  3. seberg commented on Jul 26, 2023

    @seberg

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

  4. pllim commented on Jul 26, 2023

    @pllim
    Member

    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.

  5. bsipocz commented on Jul 26, 2023

    @bsipocz
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions