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

3917 copy function to match numpy #3925

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

Conversation

ajpotts
Copy link
Contributor

@ajpotts ajpotts commented Dec 4, 2024

Creates a copy function to match numpy:
https://numpy.org/doc/2.1/reference/generated/numpy.copy.html

Also modifies the array function to operate on Strings, and to have a copy argument. When copy=False, the original array will be returned, rather than a copy, if possible.

Closes #3917 copy function to match numpy

@ajpotts ajpotts force-pushed the 3917_copy_function_to_match_numpy branch 2 times, most recently from 2297a4c to 9b2eee0 Compare December 4, 2024 17:25
@ajpotts ajpotts force-pushed the 3917_copy_function_to_match_numpy branch 2 times, most recently from c0067d1 to c990e15 Compare December 9, 2024 20:08
@ajpotts ajpotts force-pushed the 3917_copy_function_to_match_numpy branch from c990e15 to cb7d2ec Compare December 9, 2024 20:09
@ajpotts ajpotts marked this pull request as draft December 10, 2024 16:54

if isinstance(a, Strings):
cpy = a[:]
return cpy
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Call Strings.copy()

if copy is False:
if isinstance(a, (Strings, pdarray)):
return a

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check the dtype.

@@ -192,6 +199,7 @@ def array(
to create the Strings object and the two corresponding pdarrays for string
bytes and offsets, respectively.


Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add more comments about why we are changing from numpy.

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.

copy function to match numpy
1 participant