Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Pin NumPy to be lower than 2.0#1344

Closed
knyazer wants to merge 1 commit intoopenml:developopenml/openml-python:developfrom
knyazer:patch-1knyazer/openml-python:patch-1Copy head branch name to clipboard
Closed

Pin NumPy to be lower than 2.0#1344
knyazer wants to merge 1 commit intoopenml:developopenml/openml-python:developfrom
knyazer:patch-1knyazer/openml-python:patch-1Copy head branch name to clipboard

Conversation

@knyazer
Copy link
Contributor

@knyazer knyazer commented Aug 23, 2024

Fixes AttributeError: `np.sctypes` was removed in the NumPy 2.0 release. on newer NumPy versions and poetry installation

Reference Issue

None

What does this PR implement/fix? Explain your changes.

Fixes the

AttributeError: `np.sctypes` was removed in the NumPy 2.0 release. Access dtypes explicitly instead.. Did you mean: 'dtypes'?

in the sklearn extension. (line 53, sklearn/extension.py)

You might say "but nobody has ever experienced this issue!". True. For some reason, pip can figure out that the dependency should be lower than 2.0; I don't how it does it. However, I use poetry as a package manager, and if installing openml via poetry, it uses numpy 2.1 as a dependency, which breaks openml.

How should this PR be tested?

Install poetry. Then:

mkdir test && cd test && poetry init -q && poetry add openml && poetry run python -m openml

This would throw before the changes, but would not after the changes.

Any other comments?

Should be pretty easy to merge.

Fixes ```AttributeError: `np.sctypes` was removed in the NumPy 2.0 release. Access dtypes explicitly instead.. Did you mean: 'dtypes'?``` on newer NumPy versions
@PGijsbers
Copy link
Collaborator

Did you try yet to install from GitHub? The develop branch should already be numpy 2.0 compatible: #1341

@knyazer
Copy link
Contributor Author

knyazer commented Aug 23, 2024

No, I actually did not :(

Yep, it works on the development version. Annoying that it is not yet on the pypi.

Sorry for the noise, then.

@knyazer knyazer closed this Aug 23, 2024
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.