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

High-level access for deep copy #511

Closed
drahnreb opened this issue Nov 4, 2020 · 1 comment · Fixed by #514
Closed

High-level access for deep copy #511

drahnreb opened this issue Nov 4, 2020 · 1 comment · Fixed by #514
Labels
feature New feature or request

Comments

@drahnreb
Copy link
Contributor

drahnreb commented Nov 4, 2020

I used to do this (deprecated) for a deep copy:

>>> import awkward1 as ak
>>> array = ak.Array([])
>>> array.copy() # deprecated with removal of pandas integration #350 

You could do this:

>>> ak.Array(array.layout.deep_copy()) # unwrap and rewrap required similar to #496 
>>> # or
>>> import copy
>>> copy.deepcopy(array)

Would be nice to have something like this (with the same kwargs as the low-level?):

>>> ak.copy(array) # or registered np.copy() which would be strictly deep as object elements aren't supported by awkward1
@drahnreb drahnreb added the feature New feature or request label Nov 4, 2020
@jpivarski
Copy link
Member

A low level function exists for this, so it will be a matter of connecting it to the high level. Overriding __copy__ and __deepcopy__ are good ideas, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants