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

Minor fixups for future NumPy 2 compatibility #15590

Merged
merged 6 commits into from
Apr 26, 2024

Conversation

seberg
Copy link
Contributor

@seberg seberg commented Apr 24, 2024

These are some small fixes to be compatible with NumPy 2 python changes, as pointed out by the ruff with the "NPY201" rule-set.

I am not really happy with the _NUMPY_SCTYPES (reaching into what is now private, but figured that others will do so also for a while; feels like we should add a better way to do this in NumPy before removing it).
Listing the full set is also a bit ugly/convoluted, but happy to do so instead.

(I was hoping to get a bit further with testing against the NumPy 2rc, but unfortunately the numba dependency makes that at least difficult.)

xref: rapidsai/build-planning#38

@seberg seberg requested a review from a team as a code owner April 24, 2024 10:46
Copy link

copy-pr-bot bot commented Apr 24, 2024

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions bot added the Python Affects Python cuDF API. label Apr 24, 2024
The alternative is listing them all, but even that is a bit tedious
for integers, because it needs something like:

``(np.byte, np.short, np.intc, getattr(np, "long", np.int_), np.longlong)``
Copy link
Contributor

@galipremsagar galipremsagar left a comment

Choose a reason for hiding this comment

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

We could rather drop the np.unicode_ from our code instead of duplicating with np.str_ because all tests have this covered.

python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
python/cudf/cudf/tests/test_api_types.py Outdated Show resolved Hide resolved
@seberg
Copy link
Contributor Author

seberg commented Apr 24, 2024

We could rather drop the np.unicode_ from our code instead of duplicating with np.str_ because all tests have this covered.

Yeah good point, should have noticed that it was just duplicating the tests.

@galipremsagar galipremsagar added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Apr 24, 2024
@galipremsagar
Copy link
Contributor

/merge

@rapids-bot rapids-bot bot merged commit 79cd473 into rapidsai:branch-24.06 Apr 26, 2024
70 checks passed
@seberg seberg deleted the numpy2 branch April 26, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants