Skip to content

Simplify and restore old behavior for deep-copies #4453

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

Closed
wants to merge 2 commits into from

Conversation

shoyer
Copy link
Member

@shoyer shoyer commented Sep 23, 2020

Intended to fix #4449

The goal is to restore behavior to match what we had prior to #4379 for all types of data other than np.ndarray objects

Needs tests!

  • Closes #xxxx
  • Tests added
  • Passes isort . && black . && mypy . && flake8
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

@max-sixty
Copy link
Collaborator

Great, this is simpler.

PandasIndexingAdaptor loses its .copy method, but I don't think that's pubic API.

@@ -2432,42 +2437,6 @@ def concat(cls, variables, dim="concat_dim", positions=None, shortcut=False):

return cls(first_var.dims, data, attrs)

def copy(self, deep=True, data=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we keep this but use self.__copy__ under the hood?

It lines up well with Dataset.copy() and DataArray.copy()

@pep8speaks
Copy link

Hello @shoyer! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 1:1: F401 'copy' imported but unused

@jhamman
Copy link
Member

jhamman commented Sep 14, 2023

I believe this is no longer an issue. Please re-open if there's more to do here.

@jhamman jhamman closed this Sep 14, 2023
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.

Did copy(deep=True) break with 0.16.1?
5 participants