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

pin tests to numpy==1.22.3 due to dropped numpy.asscalar used by astropy 5.0.x #187

Closed
sbailey opened this issue Aug 16, 2022 · 2 comments
Closed
Assignees

Comments

@sbailey
Copy link
Contributor

sbailey commented Aug 16, 2022

numpy 1.23 dropped numpy.asscalar, which has been deprecated since version 1.16. However, astropy 5.0 still uses numpy.asscalar, and we still use astropy 5.0. It looks like we'll need to pin tests and desiconda to numpy==1.22.3 for now.

It's unclear to me why the desiutil master -> main triggered unit tests that caught this when the other repos didn't, but an example failure is below. Let's implement the github test fix here in desiutil, and then propagate the same to other repos as needed.

py/desiutil/test/test_io.py:11: in <module>
[52](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:53)
    from astropy.table import Table
[53](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:54)
/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/astropy/table/__init__.py:41: in <module>
[54](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:55)
    from .column import Column, MaskedColumn, StringTruncateWarning, ColumnInfo
[55](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:56)
/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/astropy/table/column.py:13: in <module>
[56](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:57)
    from astropy.units import Unit, Quantity
[57](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:58)
/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/astropy/units/__init__.py:17: in <module>
[58](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:59)
    from .quantity import *
[59](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:60)
/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/astropy/units/quantity.py:29: in <module>
[60](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:61)
    from .quantity_helper import (converters_and_unit, can_have_arbitrary_unit,
[61](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:62)
/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/astropy/units/quantity_helper/__init__.py:10: in <module>
[62](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:63)
    from . import helpers, function_helpers
[63](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:64)
/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/astropy/units/quantity_helper/function_helpers.py:127: in <module>
[64](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:65)
    np.asscalar,
[65](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:66)
/opt/hostedtoolcache/Python/3.8.13/x64/lib/python3.8/site-packages/numpy/__init__.py:311: in __getattr__
[66](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:67)
    raise AttributeError("module {!r} has no attribute "
[67](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:68)
E   AttributeError: module 'numpy' has no attribute 'asscalar'
[68](https://github.com/desihub/desiutil/runs/7865042526?check_suite_focus=true#step:5:69)
@weaverba137
Copy link
Member

I think in some of the other repos it's either already pinned, or the tests have dependencies that don't bring in that version.

#185 already pins numpy.

@weaverba137
Copy link
Member

Fixed in #185.

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

No branches or pull requests

2 participants