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

numpy.float deprecated #34

Closed
neoporteria opened this issue Aug 25, 2023 · 1 comment
Closed

numpy.float deprecated #34

neoporteria opened this issue Aug 25, 2023 · 1 comment
Assignees

Comments

@neoporteria
Copy link

neoporteria commented Aug 25, 2023

numpy.float deprecated, necessary to replace it to float in iwls.py

  File "c:\Users\UCG\git\unmixing_research\src\downscaling\gwrk.py", line 207, in <module>        
    params, lst_cal = GWRK_downscaling(ndvi, lst, block_size,plot_results=True)
  File "c:\Users\UCG\git\unmixing_research\src\downscaling\gwrk.py", line 89, in GWRK_downscaling 
    '    - R2: {}'.format(gwr_results.R2),
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\spglm\utils.py", line 358, in __get__
    _cachedval = self.fget(obj)
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\mgwr\gwr.py", line 1004, in R2 
    return self.D2
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\spglm\utils.py", line 358, in __get__
    _cachedval = self.fget(obj)
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\mgwr\gwr.py", line 995, in D2  
    D2 = 1.0 - (self.global_deviance / self.null_deviance)
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\spglm\utils.py", line 358, in __get__
    _cachedval = self.fget(obj)
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\mgwr\gwr.py", line 983, in null_deviance
    return self.family.deviance(self.y, self.null)
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\spglm\utils.py", line 358, in __get__
    _cachedval = self.fget(obj)
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\spglm\glm.py", line 342, in null
    return null_mod.fit().mu
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\spglm\glm.py", line 132, in fit    params, predy, w, n_iter = iwls(
  File "C:\Users\UCG\git\unmixing_research\.venv\lib\site-packages\spglm\iwls.py", line 111, in iwls
    betas = np.zeros((x.shape[1], 1), np.float)
  File "C:\Users\UCG\git\unmixing_research\.venv\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
@jGaboardi jGaboardi self-assigned this Oct 11, 2023
@jGaboardi
Copy link
Member

This was fixed in #32

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

No branches or pull requests

2 participants