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

scanspec 0.7.5 generates warnings / AttributeError in mx-bluesky CI regarding deprecated np.bool #149

Closed
rtuck99 opened this issue Oct 18, 2024 · 3 comments

Comments

@rtuck99
Copy link

rtuck99 commented Oct 18, 2024

See
https://github.com/DiamondLightSource/mx-bluesky/actions/runs/11405066552/job/31735667519?pr=585

ImportError while loading conftest '/home/runner/work/mx-bluesky/mx-bluesky/tests/conftest.py'.
tests/conftest.py:65: in <module>
    from scanspec.core import Path as ScanPath
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/scanspec/__init__.py:9: in <module>
    from . import core, regions, specs
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/scanspec/core.py:44: in <module>
    GapArray = npt.NDArray[np.bool]
/opt/hostedtoolcache/Python/3.11.10/x64/lib/python3.11/site-packages/numpy/__init__.py:319: in __getattr__
    warnings.warn(
E   FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.

Attempting to ignore this warning just leads to a later AttributeError:

ImportError while loading conftest '/home/bob/workspace/mx-bluesky/tests/conftest.py'.
tests/conftest.py:65: in <module>
    from scanspec.core import Path as ScanPath
.venv/lib/python3.11/site-packages/scanspec/__init__.py:9: in <module>
    from . import core, regions, specs
.venv/lib/python3.11/site-packages/scanspec/core.py:44: in <module>
    GapArray = npt.NDArray[np.bool]
.venv/lib/python3.11/site-packages/numpy/__init__.py:324: in __getattr__
    raise AttributeError(__former_attrs__[attr])
E   AttributeError: module 'numpy' has no attribute 'bool'.
E   `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
E   The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E       https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

@coretl
Copy link
Contributor

coretl commented Oct 18, 2024

@DiamondJoseph is this now fixed?

@DiamondJoseph
Copy link
Contributor

In 0.7.6 yes

@DiamondJoseph
Copy link
Contributor

Closed by #150

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

3 participants