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 2.0 Compatibility #604

Open
jbpezent opened this issue Jun 17, 2024 · 5 comments
Open

Numpy 2.0 Compatibility #604

jbpezent opened this issue Jun 17, 2024 · 5 comments

Comments

@jbpezent
Copy link

The recently released numpy 2.0 appears to be incompatible with latest basemap version 1.4.1. Seems to be a common issue with packages compiled against older versions of numpy. Issue observed on windows 11 with python 3.9 when importing basemap.

BaseMapError

@DWesl
Copy link
Contributor

DWesl commented Jun 20, 2024

As I recall, the fix for this would be adding metadata to the effect of requires: numpy<2.0 to existing binary wheels and (re-)compiling new binary wheels with numpy>=2.0,<3.

In the meantime, installing basemap from source with pip install --force-reinstall --no-binary :all: basemap should work until basemap does a new release with new binaries (1.4.1post1 might be fastest, but the maintainers might be close enough to 1.4.2 to wait for that). (EDIT: This will compile NumPy and Matplotlib from source, so it will likely take half an hour to an hour)

@valeriupredoi
Copy link

@DWesl I can just go open a PR at feedstock with the new pin, and create a new build, in the meantime, if you OK with that? If basemap does indeed support numpy>=2.0.0 at upstream (here), that is 🍺

@cvanelteren
Copy link

Was able to make it work with

git clone --depth 1 https://github.com/matplotlib/basemap.git
cd basemap/packages/basemap
pip install --force-reinstall --no-binary :all: basemap

Thanks!

@DWesl
Copy link
Contributor

DWesl commented Sep 10, 2024

@DWesl I can just go open a PR at feedstock with the new pin, and create a new build, in the meantime, if you OK with that? If basemap does indeed support numpy>=2.0.0 at upstream (here), that is 🍺

My platform only has up to Python 3.9, so I'm not able to check anything with NumPy 2.0 until someone works out how to compile Python 3.12 there and packages it.

@molinav
Copy link
Member

molinav commented Sep 10, 2024

My main concern while I keep the pin numpy<2.0 for now is that NumPy 2.0 brings some API breaking changes that have been waiting around for some years. Since basemap was started very long ago, I would not be surprised that basemap has some old ways of doing things (e.g. using NumPy members that were removed or moved somewhere else).

Because of that, I would like to invest a bit of time reviewing the source code before pushing a new release with potential bugs (note that the test collection is quite limited). Unfortunately, I have been a bit busy in the last months, but I have not still forgotten the latest open issues and PR.

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

5 participants