summaryrefslogtreecommitdiff
path: root/szilagyi/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'szilagyi/__init__.py')
-rw-r--r--szilagyi/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/szilagyi/__init__.py b/szilagyi/__init__.py
index 67da4a8..bfde154 100644
--- a/szilagyi/__init__.py
+++ b/szilagyi/__init__.py
@@ -7,9 +7,9 @@ There is only one function provided, so the use should be straight-forward. For
>>> import pint
>>> import szilagyi
>>> u = pint.UnitRegistry()
- >>> round(szilagyi.calculate_swi(10.5 * u.C, 24100 * u.ft), 3)
+ >>> round(szilagyi.calculate_swi(10.5 * u.delta_degC, 24100 * u.ft), 3)
0.811
- >>> round(szilagyi.calculate_swi(7 * u.C, 12500 * u.ft), 3)
+ >>> round(szilagyi.calculate_swi(7 * u.delta_degC, 12500 * u.ft), 3)
-4.88
"""
@@ -27,11 +27,11 @@ def calculate_swi(temperature_difference: Quantity, convective_cloud_depth: Quan
of the original nomogram. The maximum values are available as MAX_TEMPERATURE_DIFFERENCE and MAX_CONVECTIVE_CLOUD_DEPTH
constants.
"""
- if not temperature_difference.is_compatible_with("C"):
+ if not temperature_difference.is_compatible_with("delta_degC"):
raise ValueError("temperature_difference must be convertible to Celsius degrees")
if not convective_cloud_depth.is_compatible_with("ft"):
raise ValueError("convective_cloud_depth must be convertible to Feet")
- temperature_difference = temperature_difference.m_as("C")
+ temperature_difference = temperature_difference.m_as("delta_degC")
convective_cloud_depth = convective_cloud_depth.m_as("ft")
if temperature_difference < 0 or temperature_difference > MAX_TEMPERATURE_DIFFERENCE:
raise ValueError(f"temperature_difference must be within <0, {MAX_TEMPERATURE_DIFFERENCE}> range")