Skip to content

Sasmodel not supporting numpy 2.x, re-check when available #100

Description

@bobleesj

Running

        print(load_model_info("ellipsoid"))

provides the following error:

===================================================== ERRORS ======================================================
_______________________________________ ERROR collecting tests/test_sas.py ________________________________________
tests/test_sas.py:66: in <module>
    from sasmodels.core import load_model, load_model_info
/Users/imac/miniconda3/envs/srfit_env/lib/python3.11/site-packages/sasmodels/core.py:22: in <module>
    from . import generate
/Users/imac/miniconda3/envs/srfit_env/lib/python3.11/site-packages/sasmodels/generate.py:173: in <module>
    from .modelinfo import Parameter
/Users/imac/miniconda3/envs/srfit_env/lib/python3.11/site-packages/sasmodels/modelinfo.py:82: in <module>
    def parse_parameter(name, units='', default=np.NaN,
/Users/imac/miniconda3/envs/srfit_env/lib/python3.11/site-packages/numpy/__init__.py:400: in __getattr__
    raise AttributeError(
E   AttributeError: `np.NaN` was removed in the NumPy 2.0 release. Use `np.nan` instead.

How to navigate for now

Reinstall numpy:

    Found existing installation: numpy 2.1.3
    Uninstalling numpy-2.1.3:
      Successfully uninstalled numpy-2.1.3
Successfully installed numpy-1.26.4

======== 2 passed, 2 warnings in 3.74s =========

Reference

There is a pending PR below.

SasView/sasmodels#613

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions