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

MNT support array functions in numpy>=1.25 #373

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

adrinjalali
Copy link
Member

Persistence is broken since from numpy=1.25.0 np.mean is now dispatched via _ArrayFunctionDispatcher.

This fixes the issue.

Also opened an issue here: numpy/numpy#24019

We should do a quick minor release for this probably.

@adrinjalali
Copy link
Member Author

cc @skops-dev/maintainers

Copy link
Contributor

@lazarust lazarust left a comment

Choose a reason for hiding this comment

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

I can't merge PRs but this looks good to me!

Copy link
Collaborator

@BenjaminBossan BenjaminBossan left a comment

Choose a reason for hiding this comment

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

Ugh, this is unfortunate.

It could very well happen sooner or later that we cannot rely on singledispatch anymore because of stuff like this. Hopefully I'm wrong but I wouldn't like to write a custom dispatcher (again).

@BenjaminBossan BenjaminBossan merged commit a1c77e4 into skops-dev:main Jun 26, 2023
12 checks passed
@adrinjalali
Copy link
Member Author

The real dispatch here would be inspect.issubroutine it seems, but we can't do that with singledispatch.

@adrinjalali adrinjalali deleted the _ArrayFunctionDispatcher branch June 27, 2023 13:18
@BenjaminBossan
Copy link
Collaborator

The real dispatch here would be inspect.issubroutine it seems, but we can't do that with singledispatch.

I would suggest that as long as it only affects this one function, we can live with the workaround; if there are more of exceptions needed in the future, we might have to roll our own dispatcher that can optionally use issubroutine.

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.

3 participants