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

fix: an unexpected 'equal_nan' keyword argument #66

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

ianna
Copy link
Collaborator

@ianna ianna commented Sep 10, 2024

Fixes TypeError: _unique_dispatcher() got an unexpected keyword argument 'equal_nan'

'equal_nan' was introduced from Numpy 1.24
https://numpy.org/doc/1.24/reference/generated/numpy.unique.html

@ianna ianna requested a review from jpivarski September 10, 2024 13:43
Copy link
Collaborator Author

@ianna ianna left a comment

Choose a reason for hiding this comment

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

@jpivarski - please, check this PR when you have time. It is needed for @ohrechykha's PR #57 to pass. Thanks!

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

Without the equal_nan keyword argument, we can't satisfy the protocol specified by the Array API (without doing extra work with np.isnan to collapse multiple NaN values into a single NaN), and this was added in NumPy 1.24.

It's fine for ragged to have a tighter NumPy requirement than Awkward Array. (We don't want to increase Awkward's NumPy requirement without deliberation, since it will constrain the set of packages that can be installed in an environment.)

NumPy 1.24 is the oldest currently-supported version of NumPy, and even then, it will be discontinued this December.

For these reasons, I think I can merge it. Does ragged have a requirements-min.txt or similar that also needs to be updated? No, I don't see one, and NumPy is not explicitly mentioned in .readthedocs, either. Oh, but if we increase the minimum tested NumPy version in .github/workflows/ci.yml, we must also increase the actual installation constraint for PyPI. I'll do that now, and then merge after tests pass.

@jpivarski jpivarski enabled auto-merge (squash) September 10, 2024 18:46
Copy link
Collaborator Author

@ianna ianna left a comment

Choose a reason for hiding this comment

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

@jpivarski - the PR cannot be auto merged because it is waiting for a required 1.22 workflow to run. I don't think, I have rights to disable it.

@jpivarski jpivarski merged commit 72230bf into main Sep 11, 2024
12 checks passed
@jpivarski jpivarski deleted the ianna/fix-type-error-unique-equal_nan-keyword branch September 11, 2024 13:31
@jpivarski
Copy link
Member

Got it!

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