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

Deprecated numpy attributes used #260

Closed
sybrenstuvel opened this issue Apr 28, 2024 · 1 comment
Closed

Deprecated numpy attributes used #260

sybrenstuvel opened this issue Apr 28, 2024 · 1 comment

Comments

@sybrenstuvel
Copy link

Blender 4.1.1 on Win10/64-bit, with BlenderCam 1.0.21.

This is what happens when I press the "Calculate Relief" button in the "Bas Relief" panel:

Traceback (most recent call last):
  File "C:\Users\Sybren\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\cam\basrelief.py", line 1323, in execute
    relief(br)
  File "C:\Users\Sybren\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\cam\basrelief.py", line 987, in relief
    solve_pde_multigrid(divg, target, vcycleiterations, linbcgiterations,
  File "C:\Users\Sybren\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\cam\basrelief.py", line 304, in solve_pde_multigrid
    VF[0] = numpy.zeros((xmax, ymax), dtype=numpy.float)
                                            ^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\Lib\site-packages\numpy\__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` 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. Did you mean: 'cfloat'?
Error: Python: Traceback (most recent call last):
  File "C:\Users\Sybren\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\cam\basrelief.py", line 1323, in execute
    relief(br)
  File "C:\Users\Sybren\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\cam\basrelief.py", line 987, in relief
    solve_pde_multigrid(divg, target, vcycleiterations, linbcgiterations,
  File "C:\Users\Sybren\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\cam\basrelief.py", line 304, in solve_pde_multigrid
    VF[0] = numpy.zeros((xmax, ymax), dtype=numpy.float)
                                            ^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.1\4.1\python\Lib\site-packages\numpy\__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` 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. Did you mean: 'cfloat'?

Workaround

As a workaround, I tried this:

>>> import numpy
>>> numpy.float = numpy.float64

which got rid of the error and seems to work for me.

@pppalain
Copy link
Collaborator

pppalain commented Aug 14, 2024

thanks, it was patched. in my branch.

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

2 participants