Skip to content

Commit

Permalink
Update docstrings wrt attribute copying behaviour.
Browse files Browse the repository at this point in the history
  • Loading branch information
pp-mo committed Jan 15, 2025
1 parent 7eb0d27 commit 14ead01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions lib/ncdata/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ def copy(self):
"""
Copy self.
This duplicates structure with new ncdata core objects, but does not duplicate
data arrays. See :func:`ncdata.utils.ncdata_copy`.
This duplicates structure with all-new ncdata core objects, but does not
duplicate variable data arrays. See :func:`ncdata.utils.ncdata_copy`.
"""
from ncdata.utils import ncdata_copy

Expand Down Expand Up @@ -479,7 +479,7 @@ def copy(self):
"""
Copy self.
Does not duplicate arrays oin data or attribute content.
Does not duplicate arrays in data content.
See :func:`ncdata.utils.ncdata_copy`.
"""
from ncdata.utils._copy import _attributes_copy
Expand Down Expand Up @@ -583,12 +583,7 @@ def __str__(self): # noqa: D105
return repr(self)

def copy(self):
"""
Copy self.
Does not duplicate array content.
See :func:`ncdata.utils.ncdata_copy`.
"""
"""Copy self, including any array value content."""
return NcAttribute(self.name, self.value.copy())

def __eq__(self, other):
Expand Down
4 changes: 2 additions & 2 deletions lib/ncdata/utils/_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ def ncdata_copy(ncdata: NcData) -> NcData:
"""
Return a copy of the data.
The operation makes fresh copies of all ncdata objects, but does not copy arrays in
variable data.
The operation makes fresh copies of all ncdata objects, but does not copy variable
data arrays.
Parameters
----------
Expand Down

0 comments on commit 14ead01

Please sign in to comment.