Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Py-earth and numpy 1.25 #227

Open
pgr123 opened this issue Jul 19, 2023 · 3 comments
Open

Py-earth and numpy 1.25 #227

pgr123 opened this issue Jul 19, 2023 · 3 comments

Comments

@pgr123
Copy link

pgr123 commented Jul 19, 2023

I update numpy to the 1.25.1 version and now I got an error with py-earth (np.int is deprecated ...).
Does anyone try to use py-earth with numpy 1.25.1 and/or know how to modify the code to avoid the error ?
Thank you very much.
Have a good day.

@pgr123
Copy link
Author

pgr123 commented Jul 20, 2023

Here is the error I get when I try the example plot_v_function.py with numpy 1.25.1 :

Traceback (most recent call last):
  File "/home/pascal/Bureau/plot_v_function.py", line 12, in <module>
    from pyearth import Earth
  File "/usr/lib/python3/dist-packages/pyearth/__init__.py", line 6, in <module>
    from .earth import Earth
  File "/usr/lib/python3/dist-packages/pyearth/earth.py", line 1, in <module>
    from ._forward import ForwardPasser
  File "pyearth/_forward.pyx", line 1, in init pyearth._forward
  File "pyearth/_basis.pyx", line 12, in init pyearth._basis
  File "pyearth/_types.pyx", line 3, in init pyearth._types
  File "/home/pascal/.local/lib/python3.10/site-packages/numpy/__init__.py", line 313, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'int'.
`np.int` was a deprecated alias for the builtin `int`. To avoid this error in existing code, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
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

Can someone help me ? What can I do ?
Thank you.

@MJuddBooth
Copy link

Try my new pull request. It works for me.

@pgr123
Copy link
Author

pgr123 commented Aug 12, 2023

Thank you, I'll try it.
Have a good weekend.

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

No branches or pull requests

2 participants