FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

TST: Test copy behavior in astype by lithomas1 · Pull Request #335 · data-apis/array-api-tests · GitHub

TST: Test copy behavior in astype - #335

Draft
lithomas1 wants to merge 1 commit into
data-apis:masterfrom
lithomas1:test-astype-copy
Draft

TST: Test copy behavior in astype#335
lithomas1 wants to merge 1 commit into
data-apis:masterfrom
lithomas1:test-astype-copy

Conversation

lithomas1 commented Jan 16, 2025
edited
Loading

Copy link
Copy Markdown

The copy keyword was previously not checked.

"""
Assert copy=True/False functionality is respected

TODO: we're not able to check scalars with this approach

crusaderky Jan 16, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

We should definitely be able to check 0-dimensional arrays. What we can't check is np.generic, which AFAIK is a numpy-specific type

Comment on lines +497 to +501
def assert_kw_copy(func_name, x, out, data, copy):
"""
Assert copy=True/False functionality is respected

TODO: we're not able to check scalars with this approach

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This doesn't look right.

  • astype(copy=True) should behave like asarray(copy=True).
  • astype(copy=False) should behave like asarray(copy=None).
  • asarray(copy=False) has no matching behaviour in astype.

Copy link
Copy Markdown
Contributor

@lithomas1 any update on this?

Copy link
Copy Markdown
Author

@lithomas1 any update on this?

Planning on circling back since the dask PR is merged now.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL