Skip to content

Commit

Permalink
Fix docstrings with incorrect anchor order (#90)
Browse files Browse the repository at this point in the history
* Updated docstrings and error message to correctly represent anchor order

* Updated docstrings to maintain consistency: 'temperature-pressure pairs' now uses hypen instead of ',' or 'and'

* Updated docstrings in to maintain consistency: updated further references

* Made docstrings easier to read

* Update tephi/isopleths.py

---------

Co-authored-by: Bill Little <bill.little@metoffice.gov.uk>
  • Loading branch information
ESadek-MO and bjlittle committed Mar 24, 2023
1 parent 9387cd4 commit 4065e41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions tephi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,9 +595,9 @@ def __init__(
A :class:`tephi.Locator` instance or a numeric step size
for the dry adiabat lines.
* anchor:
A sequence of two pressure, temperature pairs specifying the extent
of the tephigram plot in terms of the bottom left hand corner and
the top right hand corner. Pressure data points must be in units of
A sequence of two (pressure, temperature) pairs specifying the extent
of the tephigram plot in terms of the bottom right-hand corner, and
the top left-hand corner. Pressure data points must be in units of
mb or hPa, and temperature data points must be in units of degC.
For example:
Expand Down Expand Up @@ -801,9 +801,9 @@ def __init__(
or len(self._anchor) != 2
):
msg = (
"Invalid anchor, expecting [(bottom-left-pressure, "
"bottom-left-temperature), (top-right-pressure, "
"top-right-temperature)]"
"Invalid anchor, expecting [(bottom-right-pressure, "
"bottom-right-temperature), (top-left-pressure, "
"top-left-temperature)]"
)
raise ValueError(msg)
(
Expand Down Expand Up @@ -839,7 +839,7 @@ def plot(self, data, **kwargs):
Args:
* data: pressure and temperature pair data points.
* data: (pressure, temperature) pair data points.
.. note::
All keyword arguments are passed through to
Expand Down
4 changes: 2 additions & 2 deletions tephi/isopleths.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _wet_adiabat_gradient(min_temperature, pressure, temperature, dp):
calculate the gradient difference.
Returns:
The gradient change as a pressure, potential temperature value pair.
The gradient change as a (pressure, potential-temperature) value pair.
"""

Expand Down Expand Up @@ -418,7 +418,7 @@ def __init__(self, data, axes):
if self.data.ndim != 2 or self.data.shape[-1] != 2:
msg = (
"The environment profile data requires to be a sequence "
"of pressure, temperature value pairs."
"of (pressure, temperature) value pairs."
)
raise ValueError(msg)
self.axes = axes
Expand Down

0 comments on commit 4065e41

Please sign in to comment.