Skip to content

Commit 49b08b2

Browse files
Update documentation for new 'key' parameter
1 parent 5588277 commit 49b08b2

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

cf/field.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9514,8 +9514,8 @@ def domain_mask(self, **kwargs):
95149514
@_inplace_enabled(default=False)
95159515
@_manage_log_level_via_verbosity
95169516
def compute_vertical_coordinates(
9517-
self, default_to_zero=True,
9518-
strict=True, inplace=False, verbose=None, key=False
9517+
self, default_to_zero=True, strict=True, key=False,
9518+
inplace=False, verbose=None,
95199519
):
95209520
"""Compute non-parametric vertical coordinates.
95219521

@@ -9550,7 +9550,7 @@ def compute_vertical_coordinates(
95509550
{{default_to_zero: `bool`, optional}}
95519551

95529552
strict: `bool`
9553-
If False then allow the computation to occur when
9553+
If False then allow the computation to occur when:
95549554

95559555
* A domain ancillary construct has no standard name, but
95569556
the corresponding term has a standard name that is
@@ -9569,15 +9569,30 @@ def compute_vertical_coordinates(
95699569
names, then an exception is raised regardless of the value
95709570
of *strict*.
95719571

9572+
key: `bool`
9573+
If True, return alongside the field construct the key
9574+
identifying the auxiliary coordinate of the field with
9575+
the newly-computed vertical coordinates, as a 2-tuple
9576+
of field and then key. If False, the default, then only
9577+
return the field construct.
9578+
9579+
If no coordinates were computed, `None` will be
9580+
returned in the key (second) position of the 2-tuple.
9581+
9582+
.. versionadded:: 3.17.0
9583+
95729584
{{inplace: `bool`, optional}}
95739585

95749586
{{verbose: `int` or `str` or `None`, optional}}
95759587

95769588
:Returns:
95779589

9578-
`Field` or `None`
9590+
`Field`, 2-tuple, or `None`
95799591
The field construct with the new non-parametric vertical
9580-
coordinates, or `None` if the operation was in-place.
9592+
coordinates, or a 2-tuple of this field construct along
9593+
with the key of the new auxiliary coordinate with the
9594+
computed vertical coordinates, or `None` if the operation
9595+
was in-place.
95819596

95829597
**Examples**
95839598

0 commit comments

Comments
 (0)