Skip to content

TST: astropy.units' tests fail against numpy 2.0 dev  #15690

Closed

Description

@neutrinoceros

Description

See for instance https://github.com/astropy/astropy/actions/runs/7127086443/job/19406282222
It looks like this is caused by new NEP-18 (array functions) compatible functions being introduced these last couple days:

I'm not currently able to tackle this problem as easily as I'd like because of another issue: it seems that nightly wheels for macOS are lagging behind, so this doesn't reproduce trivial on my machine. However I should be able to build numpy from source and provide a fix later today.

Expected behavior

No response

How to Reproduce

No response

Versions

No response

Activity

  1. neutrinoceros commented on Dec 7, 2023

    @neutrinoceros
    ContributorAuthor

    Ok here's my script to reproduce this locally even without pre-built binaries

    set -euxo pipefail
    
    # spin up env
    python -m venv .venv
    source .venv/bin/activate
    python -m pip install -U pip
    
    # build numpy from source
    python -m pip install git+https://github.com/numpy/numpy.git
    
    # build pyerfa from source against numpy 2.0 dev
    python -m pip install setuptools setuptools_scm wheel jinja2
    python -m pip install git+https://github.com/liberfa/pyerfa.git --no-build-isolation
    
    # build astropy
    python -m pip install extension-helpers Cython
    python -m pip install -e ".[test]" --no-build-isolation
    
    # run test
    pytest astropy/units/tests/test_quantity_non_ufuncs.py -vvv
  2. pllim commented on Dec 7, 2023

    @pllim
  3. neutrinoceros commented on Dec 7, 2023

    @neutrinoceros
    ContributorAuthor

    Does that mean the segfault is gone?

    yes it is. I'm working on adding the missing code in astropy.units

  4. neutrinoceros commented on Dec 7, 2023

    @neutrinoceros
    ContributorAuthor

    quick note that astropy.units.tests.test_quantity_non_ufuncs.CoverageMeta just grew some blindspots, as it is currently not able to distinguish np.linalg.outer from np.outer. I'll probably need to fix that as well to pass CI.

    edit: turns out this can be dealt with separately, so I opened another issue for it: #15692

  5. pllim commented on Dec 7, 2023

    @pllim
    Member

    @mhvk can advise here regarding units hook into numpy internals.

  6. neutrinoceros commented on Dec 7, 2023

    @neutrinoceros
    ContributorAuthor

    Good to know ! Although I do have some experience in that area since I did the equivalent job in unyt :)

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions