Skip to content

Commit cb97195

Browse files
Deprecate cyclostrophic instead of removing it
1 parent a8d1b2c commit cb97195

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

climada/hazard/trop_cyclone/trop_cyclone_windfields.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"""
2121

2222
import logging
23+
import warnings
2324
from typing import Optional, Tuple, Union
2425

2526
import numpy as np
@@ -99,6 +100,7 @@ def compute_angular_windspeeds(
99100
d_centr: np.ndarray,
100101
mask_centr_close: np.ndarray,
101102
model: int,
103+
cyclostrophic: Optional[bool] = False,
102104
model_kwargs: Optional[dict] = None,
103105
):
104106
"""Compute (absolute) angular wind speeds according to a parametric wind profile
@@ -116,13 +118,25 @@ def compute_angular_windspeeds(
116118
Wind profile model selection according to MODEL_VANG.
117119
model_kwargs: dict, optional
118120
If given, forward these kwargs to the selected model. Default: None
121+
cyclostrophic: bool, optional, deprecated
122+
This argument is deprecated and will be removed in a future release.
123+
Include `cyclostrophic` as `model_kwargs` instead.
119124
120125
Returns
121126
-------
122127
ndarray of shape (npositions, ncentroids)
123128
containing the magnitude of the angular windspeed per track position per centroid location
124129
"""
125130
model_kwargs = {} if model_kwargs is None else model_kwargs
131+
132+
if cyclostrophic is not None:
133+
warnings.warn(
134+
"The 'cyclostrophic' argument is deprecated and will be removed in a future"
135+
"release. Include it in 'model_kwargs' instead.",
136+
DeprecationWarning,
137+
)
138+
model_kwargs["cyclostrophic"] = cyclostrophic
139+
126140
compute_funs = {
127141
MODEL_VANG["H1980"]: _compute_angular_windspeeds_h1980,
128142
MODEL_VANG["H08"]: _compute_angular_windspeeds_h08,

0 commit comments

Comments
 (0)