Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

tidy: Improve comment on np-special casing#10514

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
danra wants to merge1 commit intopydata:main
base:main
Choose a base branch
Loading
fromdanra:remove_np_special_case

Conversation

danra
Copy link

np.astype became available in numpy 2.1

@welcomeWelcome
Copy link

welcomebot commentedJul 8, 2025

Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in ourcontributing guidelines.

@github-actionsgithub-actionsbot added topic-documentation topic-arraysrelated to flexible array support labelsJul 8, 2025
@danra
Copy link
Author

Looks like this is failing due to dask not having implementednp.astype. Not familiar with dask. Shall I just close this, or should this be amended somehow to only usenp.astype in the numpy, non-dask case?

@keewis
Copy link
Collaborator

keewis commentedJul 8, 2025
edited
Loading

it's not just that: we're still maintaining backwards compatibility withnumpy<2 (see the bare-minimum CI), which means that we still need the special-casing for that, as well.

Either way, thanks for the PR. Unfortunately, I think this might not be the right time, yet.

Edit: but maybe you can repurpose the PR to make the comment more accurate? I.e. that this is for backwards-compat anddask?

danra reacted with thumbs up emoji

@danradanraforce-pushed theremove_np_special_case branch 2 times, most recently fromfeb81db to0ef6138CompareJuly 9, 2025 20:06
@danra
Copy link
Author

@keewis Done.
I still don't know why this is needed for dask - doesn't it use its own namespace? I've no experience with dask.
Perhaps you'd like to make that clearer in the comment and/or commit message (besides also telling me).

@danradanra changed the titletidy: Remove no longer needed np-special casingtidy: Improve comment on np-special casingJul 9, 2025
@keewis
Copy link
Collaborator

keewis commentedJul 10, 2025
edited
Loading

I think you force-pushed back to the original state (I think we need the changes fromfeb81db).

dask doesn't follow the array API (yet?), which explains the missing function

@danradanraforce-pushed theremove_np_special_case branch from0ef6138 to71e3771CompareJuly 10, 2025 17:51
@danra
Copy link
Author

Oops, sorry about that, pushed again.

@danra
Copy link
Author

dask doesn't follow the array API (yet?), which explains the missing function

but I didn't get why it's under the conditionif xp == np

np.astype became available in numpy 2.0The special case is still needed, however, to support older numpy as well as dask.
@danradanraforce-pushed theremove_np_special_case branch from71e3771 to70cc63dCompareJuly 10, 2025 18:16
@keewis
Copy link
Collaborator

Thanks! This looks good to me.

but I didn't get why it's under the conditionif xp == np

dask doesn't implement__array_namespace__, so we're falling back tonp to dispatch through__array_function__ and__array_ufunc__.

@danra
Copy link
Author

dask doesn't implementarray_namespace, so we're falling back to np to dispatch througharray_function andarray_ufunc.

Ah, I see. Thanks!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
topic-arraysrelated to flexible array support
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@danra@keewis@dcherian

[8]ページ先頭

©2009-2025 Movatter.jp