Skip to content

update numpy dependency to >=2.0#358

Closed
clausmichele wants to merge 4 commits into
Open-EO:mainfrom
Eurac-Research-Institute-for-EO:numpy2
Closed

update numpy dependency to >=2.0#358
clausmichele wants to merge 4 commits into
Open-EO:mainfrom
Eurac-Research-Institute-for-EO:numpy2

Conversation

@clausmichele

Copy link
Copy Markdown
Member

This PR includes a specific reference to the updated parser supporting numpy 2.0 from here Open-EO/openeo-pg-parser-networkx#113

Once that PR gets merged, installing it from git can be removed from the pyproject.toml file.

Comment thread pyproject.toml
pyarrow = ">=15.0.2"
openeo = ">=0.36.0"
numpy = { version = "<2.0.0", optional = false }
numpy = { version = ">=2.0.0", optional = false }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions used by this PR seem to exist in numpy 1.26 (https://numpy.org/doc/1.26/reference/generated/numpy.issubdtype.html for example), can the bound be lowered to >=1.26?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the changes locally with 1.26 now and can confirm it works, so I agree, lowering the bound to 1.26 makes sense!

def get_scalar_type(obj):
if np.isscalar(obj):
return np.obj2sctype(type(obj))
return np.dtype(type(obj))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at https://numpy.org/doc/stable/numpy_2_0_migration_guide.html for obj2sctype, should this be np.dtype(obj).type (or possibly np.dtype(type(obj)).type)?

@suriyahgit

Copy link
Copy Markdown
Member

Solved this issue by merging this PR: #372

@suriyahgit suriyahgit closed this Jun 9, 2026
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

Successfully merging this pull request may close these issues.

4 participants