Skip to content

Numpy version incompatibility #5

Description

@roxyboy

This is not a huge issue but in case you decide to use numpy versions higher than 1.20, this will throw the following error.

prepare_evp(k, l, S, dqbdy, dqbdx, U, V, nu, nu4, bf, sd, mat_format)
     26   p2q = np.copy(S)
     27   p2q[di] -= k2
---> 29   diag1 = np.array(k*dqbdy - l*dqbdx,dtype=np.complex)
     30 #  diag1 = diag1 + 1j*(k2**2*nu + k2**3*nu4) # viscosity on momentum only
     31   diag1[-1] += 1j*k2*bf

File /work/ba1254/b383315/conda/envs/growthrates/lib/python3.12/site-packages/numpy/__init__.py:775, in __getattr__(attr)
    770     warnings.warn(
    771         f"In the future `np.{attr}` will be defined as the "
    772         "corresponding NumPy scalar.", FutureWarning, stacklevel=2)
    774 if attr in __former_attrs__:
--> 775     raise AttributeError(__former_attrs__[attr], name=None)
    777 if attr in __expired_attributes__:
    778     raise AttributeError(
    779         f"`np.{attr}` was removed in the NumPy 2.0 release. "
    780         f"{__expired_attributes__[attr]}",
    781         name=None
    782     )

AttributeError: module 'numpy' has no attribute 'complex'.
`np.complex` was a deprecated alias for the builtin `complex`. To avoid this error in existing code, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions