Skip to content

TST: Test copy behavior in astype #335

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lithomas1
Copy link

@lithomas1 lithomas1 commented Jan 16, 2025

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
Copy link
Contributor

@crusaderky crusaderky Jan 16, 2025

Choose a reason for hiding this comment

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

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
Contributor

Choose a reason for hiding this comment

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

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.

@crusaderky
Copy link
Contributor

@lithomas1 any update on this?

@lithomas1
Copy link
Author

@lithomas1 any update on this?

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants