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

Copy semantics change in numpy 2.0 caused incompatibility with astropy v6.1rc #1129

Closed
pllim opened this issue Apr 5, 2024 · 2 comments · Fixed by #1130
Closed

Copy semantics change in numpy 2.0 caused incompatibility with astropy v6.1rc #1129

pllim opened this issue Apr 5, 2024 · 2 comments · Fixed by #1130
Labels

Comments

@pllim
Copy link
Member

pllim commented Apr 5, 2024

Please see:

    def test_quantity_model():
        c = modeling.models.Chebyshev1D(3)
        uc = QuantityModel(c, u.AA, u.km)
    
>       assert uc(10*u.nm).to(u.m) == 0*u.m

specutils/tests/test_utils.py:26: 
...
E       ValueError: Unable to avoid copy while creating an array as requested.
E       If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x).
E       For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.

Example logs:

cc @astrofrog @neutrinoceros

@pllim
Copy link
Member Author

pllim commented Apr 5, 2024

I might be able to patch this... See #1130

@pllim
Copy link
Member Author

pllim commented Apr 5, 2024

I can reproduce this error in this repo now that astropy nightly wheel upload is fixed. A previously green job now fails: https://github.com/astropy/specutils/actions/runs/8531304724/job/23500820517

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

Successfully merging a pull request may close this issue.

1 participant