Skip to content

NumPy Compatibility Issues: np.string_ Error with NumPy 2.0 and numpy._core.numeric Missing in Older Versions #528

Open
@yiiiwuuu

Description

Hello,

I'm encountering compatibility issues with NumPy when running BlueSky.

Problem Description:

  1. Using NumPy 2.0.0.dev0:
    When I have NumPy version 2.0.0.dev0 installed, running BlueSky results in the following error:
    AttributeError: np.string_was removed in the NumPy 2.0 release. Usenp.bytes_ instead.
    This error occurs in glnavdata.py at line 123:
    npwpids = np.array(wptids, dtype=np.string_)

  2. Using Older NumPy Versions (e.g., 1.21.0):
    When I downgrade NumPy to version 1.21.0 or 1.24.0, I receive a different error upon running BlueSky:

Bluesky needs numpy._core.numeric
Install using e.g. pip install numpy._core.numeric
BlueSky normal end.

Environment Information:
Operating System: Windows 11
Python Version: 3.10
BlueSky Version: Installed via pip install bluesky-simulator[full]
NumPy Versions Tried: 2.0.0.dev0, 1.24.0, 1.21.0

Steps to Reproduce:

  1. Install BlueSky and NumPy:
pip install bluesky-simulator[full]
pip install numpy==2.0.0.dev0  # For the first error
# or
pip install numpy==1.21.0      # For the second error
2. Run BlueSky:
bluesky
  1. Observe the respective errors mentioned above.

Questions:

  • Is there a recommended NumPy version that is fully compatible with BlueSky?
  • How can I resolve these conflicting errors when using different NumPy versions?

Additional Notes:

Modifying the source code (e.g., replacing np.string_ with np.bytes_) might be a workaround for the first error, but I'm unsure of the implications.
When using older NumPy versions, the module numpy._core.numeric seems to be missing, leading to the second error.
Any guidance on how to resolve these issues would be greatly appreciated.

Thank you!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions