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

MAINT: Remove np.int_ #3761

Merged
merged 3 commits into from
Oct 6, 2023
Merged

MAINT: Remove np.int_ #3761

merged 3 commits into from
Oct 6, 2023

Conversation

mtsokol
Copy link
Contributor

@mtsokol mtsokol commented Oct 3, 2023

Hi!
This PR addresses changes that will be shipped in numpy/numpy#24794 - deprecation of np.int_ and np.uint.

Additionally, I see that in the codebase you use np.lib.function_base._parse_gufunc_signature. It's a private function and it will raise an attribute error for NumPy 2.0:

AttributeError: `np.lib.function_base` is now private. If you are using a public function, it should be available in the main numpy namespace, otherwise check the NumPy 2.0 migration guide.

I think there are two options:

  1. The call to the private function could be removed from the codebase (e.g. by vendoring implementation - I think it's just a couple lines long).
  2. NumPy could potentially make this function part of the public API.

What is your opinion?

@Zac-HD
Copy link
Member

Zac-HD commented Oct 3, 2023

Thanks so much for the PR! Fixing this in Numpy and the ecosystem is well above and beyond the call of duty 🤩

To get CI to pass, we'll just need to create hypothesis-python/RELEASE.rst with contents such as:

RELEASE_TYPE: patch

This patch makes some small changes to our NumPy integration to ensure forward compatibility.
Thanks to Mateusz Sokół for :pull:`3761`.

(and I'd be delighted if you added yourself to the AUTHORS.rst too)

As to np.lib.function_base._parse_gufunc_signature, it looks like we only use that in our tests to check that our independent implementation is consistent with NumPy's. Let's just delete that part of the test, the implementation is clearly stable 😁

@mtsokol
Copy link
Contributor Author

mtsokol commented Oct 5, 2023

Hi @Zac-HD! The PR is ready from my side.

@Zac-HD Zac-HD enabled auto-merge October 6, 2023 06:07
@Zac-HD Zac-HD merged commit 34efa33 into HypothesisWorks:master Oct 6, 2023
47 checks passed
@mtsokol mtsokol deleted the remove-int_ branch October 6, 2023 07:36
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