From 04e10a17ee6b68c70aa94a603391c1007b3d4f3e Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 26 Feb 2025 23:54:38 -0500 Subject: [PATCH] docstrings go under function declarations --- lib/xmet/thermo.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/xmet/thermo.py b/lib/xmet/thermo.py index 380cf57..cf0e61b 100644 --- a/lib/xmet/thermo.py +++ b/lib/xmet/thermo.py @@ -11,34 +11,34 @@ def saturated_vapor_pressure(temp: float) -> float: (7.5 * temp) / (237.3 * temp) ) -""" -Return the amount, in grams, of water vapor versus dry air in a parcel of a -given dewpoint and pressure. -""" def mixing_ratio(dewpoint: float, pressure: float) -> float: + """ + Return the amount, in grams, of water vapor versus dry air in a parcel of + a given dewpoint and pressure. + """ e = vapor_pressure(dewpoint) return 621.97 * (e / (pressure - e)) -""" -Return the maximum amount, in grams, of water vapor a parcel of a given -temperature and pressure can hold. -""" def saturated_mixing_ratio(temp: float, pressure: float) -> float: + """ + Return the maximum amount, in grams, of water vapor a parcel of a given + temperature and pressure can hold. + """ es = saturated_vapor_pressure(temp) return 621.97 * (es / (pressure - es)) -""" -Return the height, in meters, at which a parcel of the given temperature is -cooled to the given dewpoint. -""" def lcl(temp: float, dewpoint: float) -> float: + """ + Return the height, in meters, at which a parcel of the given temperature + is cooled to the given dewpoint. + """ return (temp - dewpoint) / 0.008 -""" -Return the temperature of a parcel cooled at either the dry or moist lapse -rate for a given increase in height (in meters). -""" def lapse(temp: float, rate: float, delta: float) -> float: + """ + Return the temperature of a parcel cooled at either the dry or moist lapse + rate for a given increase in height (in meters). + """ return temp - (rate * (delta / 1000))