Skip to content

Commit

Permalink
Merge pull request #183 from sadielbartholomew/docs-double-negatives
Browse files Browse the repository at this point in the history
Documentation: avoid use of double negatives for clarity
  • Loading branch information
sadielbartholomew authored May 18, 2022
2 parents f40c52d + 5f8400b commit a9816e0
Show file tree
Hide file tree
Showing 29 changed files with 93 additions and 116 deletions.
4 changes: 2 additions & 2 deletions cfdm/constructs.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,8 @@ def copy(self, data=True):
:Parameters:
data: `bool`, optional
If False then do not copy data contained in the metadata
constructs. By default such data are copied.
If True (the default) then copy data contained in the
metadata constructs.
:Returns:
Expand Down
8 changes: 4 additions & 4 deletions cfdm/core/abstract/propertiesdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ def copy(self, data=True):
:Parameters:
data: `bool`, optional
If False then do not copy data. By default data are
copied.
If True (the default) then copy data, else the
data is not copied.
:Returns:
Expand Down Expand Up @@ -397,8 +397,8 @@ def set_data(self, data, copy=True, inplace=True):
{{data_like}}
copy: `bool`, optional
If False then do not copy the data prior to insertion. By
default the data are copied.
If True (the default) then copy the data prior to
insertion, else the data is not copied.
{{inplace: `bool`, optional (default True)}}
Expand Down
8 changes: 4 additions & 4 deletions cfdm/core/abstract/propertiesdatabounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ def set_bounds(self, bounds, copy=True):
The bounds to be inserted.
copy: `bool`, optional
If False then do not copy the bounds prior to
insertion. By default the bounds are copied.
If True (the default) then copy the bounds prior to
insertion, else the bounds are not copied.
:Returns:
Expand Down Expand Up @@ -701,8 +701,8 @@ def set_interior_ring(self, interior_ring, copy=True):
The interior_ring to be inserted.
copy: `bool`, optional
If False then do not copy the interior_ring prior to
insertion. By default the interior_ring are copied.
If True (the default) then copy the interior_ring
prior to insertion, else it is not copied.
:Returns:
Expand Down
10 changes: 4 additions & 6 deletions cfdm/core/constructs.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def __init__(
constructs from those of *source*.
copy: `bool`, optional
If False then do not deep copy metadata constructs
from those of *source* prior to initialisation. By
default such metadata constructs are deep copied.
If True (the default) then deep copy metadata constructs
from those of *source* prior to initialisation, else they
are not deep copied.
_ignore: sequence of `str`, optional
Ignores the given construct types.
Expand Down Expand Up @@ -979,9 +979,7 @@ def copy(self, data=True):
:Parameters:
data: `bool`, optional
If False then do not copy data contained in the
metadata constructs. By default such data are copied.
{{data: `bool`, optional}}
:Returns:
Expand Down
9 changes: 2 additions & 7 deletions cfdm/core/coordinatereference.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,7 @@ def set_coordinate_conversion(self, coordinate_conversion, copy=True):
coordinate_conversion: `CoordinateConversion`
The coordinate conversion component to be inserted.
copy: `bool`, optional
If False then do not copy the coordinate conversion prior
to insertion. By default the coordinate conversion is
copied.
{{copy: `bool`, optional}}
:Returns:
Expand Down Expand Up @@ -665,9 +662,7 @@ def set_datum(self, datum, copy=True):
datum: `Datum`
The datum component to be inserted.
copy: `bool`, optional
If False then do not copy the datum prior to insertion. By
default the datum is copied.
{{copy: `bool`, optional}}
:Returns:
Expand Down
4 changes: 2 additions & 2 deletions cfdm/core/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ def copy(self, array=True):
:Parameters:
array: `bool`, optional
If False then do not copy the array. By default the array
is copied.
If True (the default) then copy the array, else the
array is not copied.
:Returns:
Expand Down
4 changes: 1 addition & 3 deletions cfdm/core/dimensioncoordinate.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ def set_data(self, data, copy=True, inplace=True):
{{data_like}}
copy: `bool`, optional
If False then do not copy the data prior to insertion. By
default the data are copied.
{{data copy: `bool`, optional}}
{{inplace: `bool`, optional (default True)}}
Expand Down
23 changes: 17 additions & 6 deletions cfdm/core/docstring/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@
raised instead.""",
# inplace: `bool`, optional (default True)
"{{inplace: `bool`, optional (default True)}}": """inplace: `bool`, optional:
If False then do not do the operation in-place and
return a new, modified `{{class}}` instance. By
default the operation is in-place and `None` is
returned.""",
If True (the default) then do the operation in-place and
return `None`. If False a new, modified `{{class}}`
instance is returned.""",
# init properties
"{{init properties: `dict`, optional}}": """properties: `dict`, optional
Set descriptive properties. The dictionary keys are
Expand Down Expand Up @@ -105,8 +104,8 @@
initialisation with the `set_interior_ring` method.""",
# init copy
"{{init copy: `bool`, optional}}": """copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
If True (the default) deep copy input parameters prior
to initialisation. If False arguments are not deep
copied.""",
# init source
"{{init source}}": """Note that if *source* is a `{{class}}` instance then
Expand All @@ -117,4 +116,16 @@
to a `Data` object, i.e. `numpy` array_like objects,
`Data` objects, and {{package}} instances that contain
`Data` objects.""",
# data: `bool`, optional
"{{data: `bool`, optional}}": """data: `bool`, optional
If True (the default) then copy data contained in the
metadata construct(s), else the data is not copied.""",
# (component-based) copy: `bool`, optional
"{{copy: `bool`, optional}}": """copy: `bool`, optional
If True (the default) then copy the component prior to
insertion, else it is not copied.""",
# data copy: `bool`, optional
"{{data copy: `bool`, optional}}": """copy: `bool`, optional
If True (the default) then copy the data prior to
insertion, else the data is not copied.""",
}
4 changes: 1 addition & 3 deletions cfdm/core/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ def copy(self, data=True):
:Parameters:
data: `bool`, optional
If False then do not copy data. By default data are
copied.
{{data: `bool`, optional}}
:Returns:
Expand Down
4 changes: 1 addition & 3 deletions cfdm/core/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,7 @@ def set_data(self, data, axes=None, copy=True, inplace=True):
*Parameter example:*
``axes=None``
copy: `bool`, optional
If False then do not copy the data prior to insertion. By
default the data are copied.
{{data copy: `bool`, optional}}
{{inplace: `bool`, optional (default True)}}
Expand Down
8 changes: 5 additions & 3 deletions cfdm/core/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ def environment(display=True, paths=True):
:Parameters:
display: `bool`, optional
If False then return the description of the environment as
a string. By default the description is printed.
If True (the default) then display the description of the
environment as a string. If False the description is
instead returned as a list.
paths: `bool`, optional
If False then do not output the locations of each package.
If True (the default) then output the locations of each
package. If False the locations are not included.
:Returns:
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/abstract/raggedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,7 @@ def __init__(
{{init source}}
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
"""
if count_variable is not None:
Expand Down
9 changes: 3 additions & 6 deletions cfdm/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,7 @@ def __init__(
{{init source}}
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
kwargs: ignored
Not used. Present to facilitate subclassing.
Expand Down Expand Up @@ -1274,8 +1271,8 @@ def copy(self, array=True):
:Parameters:
array: `bool`, optional
If False then do not copy the array. By default the array
is copied.
If True (the default) then copy the array, else it
is not copied.
:Returns:
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/gatheredarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ def __init__(
.. versionadded:: (cfdm) 1.9.TODO.0
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
.. versionadded:: (cfdm) 1.9.TODO.0
Expand Down
9 changes: 3 additions & 6 deletions cfdm/data/netcdfarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def __init__(
The number of array dimensions in the netCDF file.
mask: `bool`
If False then do not mask by convention when reading data
from disk. By default data is masked by convention.
If True (the default) then mask by convention when
reading data from disk.
A netCDF array is masked depending on the values of any of
the netCDF variable attributes ``valid_min``,
Expand All @@ -97,10 +97,7 @@ def __init__(
.. versionadded:: (cfdm) 1.9.TODO.0
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
.. versionadded:: (cfdm) 1.9.TODO.0
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/raggedcontiguousarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ def __init__(
.. versionadded:: (cfdm) 1.9.TODO.0
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
.. versionadded:: (cfdm) 1.9.TODO.0
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/raggedindexedarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ def __init__(
.. versionadded:: (cfdm) 1.9.TODO.0
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
.. versionadded:: (cfdm) 1.9.TODO.0
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/raggedindexedcontiguousarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ def __init__(
.. versionadded:: (cfdm) 1.9.TODO.0
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
.. versionadded:: (cfdm) 1.9.TODO.0
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/subarray/abstract/subarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ def __init__(
{{init source}}
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
context_manager: function, optional
A context manager that provides a runtime context for
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/subarray/abstract/subsampledsubarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ def __init__(
{{init source}}
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
context_manager: function, optional
A context manager that provides a runtime context for
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/subarray/gatheredsubarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ def __init__(
{{init source}}
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
context_manager: function, optional
A context manager that provides a runtime context for
Expand Down
5 changes: 1 addition & 4 deletions cfdm/data/subsampledarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,7 @@ def __init__(
{{init source}}
copy: `bool`, optional
If False then do not deep copy input parameters prior
to initialisation. By default arguments are deep
copied.
{{deep copy}}
"""
super().__init__(
Expand Down
9 changes: 7 additions & 2 deletions cfdm/docstring/docstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
``name='data1'``""",
# header: `bool`, optional
"{{header: `bool`, optional}}": """header: `bool`, optional
If False then do not output a comment describing the
components.""",
If True (the default) output a comment describing the
components. If False no such comment is returned.""",
# ignore_compression: `bool`, optional
"{{ignore_compression: `bool`, optional}}": """ignore_compression: `bool`, optional
If False then the compression type and, if applicable,
Expand Down Expand Up @@ -345,6 +345,11 @@
By default, *chunks* is ``-1``, meaning that all
non-compressed dimensions in each subarray have the
maximum possible size.""",
# deep copy
"{{deep copy}}": """copy: `bool`, optional
If True (the default) then deep copy input
parameters prior to initialisation, else they are
not (deep) copied.""",
# ----------------------------------------------------------------
# Method description susbstitutions (4 levels of indentataion)
# ----------------------------------------------------------------
Expand Down
Loading

0 comments on commit a9816e0

Please sign in to comment.