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

Allow __dlpack__ to work with newer versions of NumPy #86

Merged
merged 4 commits into from
Nov 8, 2024

Conversation

asmeurer
Copy link
Member

@asmeurer asmeurer commented Nov 7, 2024

Fixes #85

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no suggestions.

raise NotImplementedError("The device argument to __dlpack__ is not yet implemented")
if copy not in [_default, None]:
raise NotImplementedError("The copy argument to __dlpack__ is not yet implemented")
if np.__version__[0] < '2.1':
Copy link

Choose a reason for hiding this comment

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

This is incorrect:

>>> np.__version__
'2.1.3'
>>> np.__version__[0] < '2.1'
True

numpy.lib.NumpyVersion can be used here

@asmeurer
Copy link
Member Author

asmeurer commented Nov 8, 2024

I think I'm going to just drop NumPy 1.x support in a subsequent PR.

@asmeurer asmeurer merged commit f8e7c84 into data-apis:main Nov 8, 2024
21 checks passed
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.

The max_version argument to __dlpack__ is not yet implemented
2 participants