Closed quickbrett closed 10 months ago
Thanks for pointing the bug! Just out of curiosity, which numpy
version are you using?
I'm using the following versions:
@quickbrett thanks for raising this issue and proposing the fix and @molinav thanks for maintaining this still great package. I actually got the same error, I think it is related to the latest numpy versions.
It seems that numpy.float
was removed with its release 1.24.0 (https://numpy.org/devdocs/release/1.24.0-notes.html). I will replace it with the Python builtin float
as suggested in the link.
Hopefully I can get some time soon to start a basic unit test collection, because these issues would be identified immediately with the automatic tests.
@quickbrett I just added the patch in a hotfix branch (1.3.9), your small example now works after the correction. I took this moment to correct all the references to numpy.float
that I found in the whole library, mostly replaced with numpy.float64
.
I am not sure when I will release 1.3.9, maybe I will do a couple of bugfixes more that are still around before tagging.
@molinav I installes the hotfix branch
pip install git+https://github.com/matplotlib/basemap@hotfix-1.3.9#subdirectory=packages/basemap
Hence I'm using the following package versions (pip list
):
I tested the new version with a few simple examples and it worked for me.
Thanks!
@quickbrett I have just added a couple of unit tests for Basemap.shadedrelief
based on your snippet, so I am finally closing this issue. The bugfix will come with basemap
1.3.9 (hopefully soon).
This small example retrurns an error
The error message:
I belive, the wrong attribute is used in
packages/basemap/src/mpl_toolkits/basemap/__init__.py
, master branch, line 4186.This small patch works for me:
Thanks for the great package!