Skip to content

Commit 8bb1011

Browse files
Merge branch 'develop'
2 parents 5fba3ab + 0c462e8 commit 8bb1011

File tree

16 files changed

+133
-107
lines changed

16 files changed

+133
-107
lines changed

climada/engine/unsequa/calc_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def make_sample(self, N, sampling_method="saltelli", sampling_kwargs=None):
207207
sampling_method : str, optional
208208
The sampling method as defined in SALib. Possible choices:
209209
'saltelli', 'latin', 'morris', 'dgsm', 'fast_sampler', 'ff', 'finite_diff',
210-
https://salib.readthedocs.io/en/latest/api.html
210+
https://salib.readthedocs.io/en/latest/api.html
211211
The default is 'saltelli'.
212212
sampling_kwargs : kwargs, optional
213213
Optional keyword arguments passed on to the SALib sampling_method.
@@ -228,7 +228,6 @@ def make_sample(self, N, sampling_method="saltelli", sampling_kwargs=None):
228228
requirement. Please refer to https://salib.readthedocs.io/en/latest/api.html
229229
for more details.
230230
231-
232231
See Also
233232
--------
234233
SALib.sample: sampling methods from SALib SALib.sample

climada/engine/unsequa/calc_cost_benefit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ class CalcCostBenefit(Calc):
7777
_metric_names : tuple(str)
7878
Names of the cost benefit output metrics
7979
('tot_climate_risk', 'benefit', 'cost_ben_ratio',
80-
'imp_meas_present', 'imp_meas_future')
81-
80+
'imp_meas_present', 'imp_meas_future')
8281
"""
8382

8483
_input_var_names = (

climada/engine/unsequa/calc_delta_climate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CalcDeltaImpact(Calc):
8181
_input_var_names : tuple(str)
8282
Names of the required uncertainty input variables
8383
('exp_initial_input_var', 'impf_initial_input_var', 'haz_initial_input_var',
84-
'exp_final_input_var', 'impf_final_input_var', 'haz_final_input_var'')
84+
'exp_final_input_var', 'impf_final_input_var', 'haz_final_input_var'')
8585
_metric_names : tuple(str)
8686
Names of the impact output metrics
8787
('aai_agg', 'freq_curve', 'at_event', 'eai_exp')

climada/entity/exposures/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,10 @@ def get_impf_column(self, haz_type=""):
549549
str
550550
a column name, the first of the following that is present in the exposures' dataframe:
551551
552-
- ``impf_[haz_type]``
553-
- ``if_[haz_type]``
554-
- ``impf_``
555-
- ``if_``
552+
* ``impf_[haz_type]``
553+
* ``if_[haz_type]``
554+
* ``impf_``
555+
* ``if_``
556556
557557
Raises
558558
------

climada/hazard/base.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,12 @@ def check_matrices(self):
225225
--------
226226
:py:func:`climada.util.checker.prune_csr_matrix`
227227
228-
Todo
229-
-----
230-
* Check consistency with centroids
231-
232228
Raises
233229
------
234230
ValueError
235231
If matrices are ill-formed or ill-shaped in relation to each other
236232
"""
233+
# TODO: Check consistency with centroids
237234
u_check.prune_csr_matrix(self.intensity)
238235
u_check.prune_csr_matrix(self.fraction)
239236
if self.fraction.nnz > 0:

climada/hazard/io.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ def from_xarray_raster(
398398
* ``event_name``: String representation of the event date or empty strings
399399
if that fails (which will issue a warning).
400400
* ``event_id``: Consecutive integers starting at 1 and increasing with time
401+
401402
crs : str, optional
402403
Identifier for the coordinate reference system of the coordinates. Defaults
403404
to ``EPSG:4326`` (WGS 84), defined by ``climada.util.constants.DEF_CRS``.

climada/hazard/storm_europe.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,10 @@ def generate_prob_storms(
836836
levels are shifted by n raster pixels into each direction (N/S/E/W).
837837
838838
Caveats:
839-
- Memory safety is an issue; trial with the entire dataset resulted
839+
* Memory safety is an issue; trial with the entire dataset resulted
840840
in 60GB of swap memory being used...
841-
- Can only use numeric region_id for country selection
842-
- Drops event names as provided by WISC
841+
* Can only use numeric region_id for country selection
842+
* Drops event names as provided by WISC
843843
844844
Parameters
845845
----------

climada/hazard/tc_clim_change.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,15 @@ def get_knutson_scaling_factor(
7171
in Jewson et al., (2021).
7272
7373
Related publications:
74-
- Knutson et al., (2020): Tropical cyclones and climate
75-
change assessment. Part II: Projected response to anthropogenic warming.
76-
Bull. Amer. Meteor. Soc., 101 (3), E303–E322,
77-
https://doi.org/10.1175/BAMS-D-18-0194.1.
7874
79-
- Jewson (2021): Conversion of the Knutson et al. (2020) Tropical Cyclone
80-
Climate Change Projections to Risk Model Baselines,
81-
https://doi.org/10.1175/JAMC-D-21-0102.1
75+
- Knutson et al., (2020): Tropical cyclones and climate
76+
change assessment. Part II: Projected response to anthropogenic warming.
77+
Bull. Amer. Meteor. Soc., 101 (3), E303–E322,
78+
https://doi.org/10.1175/BAMS-D-18-0194.1.
79+
80+
- Jewson (2021): Conversion of the Knutson et al. (2020) Tropical Cyclone
81+
Climate Change Projections to Risk Model Baselines,
82+
https://doi.org/10.1175/JAMC-D-21-0102.1
8283
8384
Parameters
8485
----------
@@ -94,21 +95,24 @@ def get_knutson_scaling_factor(
9495
the provided percentiles are the 10th, 25th, 50th, 75th and 90th. Please refer to the
9596
mentioned publications for more details.
9697
possible percentiles:
97-
'5/10' either the 5th or 10th percentile depending on variable (see text above)
98-
'25' for the 25th percentile
99-
'50' for the 50th percentile
100-
'75' for the 75th percentile
101-
'90/95' either the 90th or 95th percentile depending on variable (see text above)
98+
99+
* '5/10' either the 5th or 10th percentile depending on variable (see text above)
100+
* '25' for the 25th percentile
101+
* '50' for the 50th percentile
102+
* '75' for the 75th percentile
103+
* '90/95' either the 90th or 95th percentile depending on variable (see text above)
104+
102105
Default: '50'
103106
basin : str
104107
region of interest, possible choices are:
105-
'NA', 'WP', 'EP', 'NI', 'SI', 'SP'
108+
'NA', 'WP', 'EP', 'NI', 'SI', 'SP'
106109
baseline : tuple of int
107110
the starting and ending years that define the historical
108111
baseline. The historical baseline period must fall within
109112
the GSMT data period, i.e., 1880-2100. Default is 1982-2022.
110113
yearly_steps : int
111114
yearly resolution at which projections are provided. Default is 5 years.
115+
112116
Returns
113117
-------
114118
future_change_variable : pd.DataFrame
@@ -207,10 +211,11 @@ def get_gmst_info():
207211
-------
208212
gmst_info : dict
209213
dictionary with four keys, which are:
210-
- rcps: list of strings referring to RCPs 2.6, 4.5, 6.0 and 8.5
211-
- gmst_start_year: integer with the GMST data starting year, 1880
212-
- gmst_end_year: integer with the GMST data ending year, 2100
213-
- gmst_data: array with GMST data across RCPs (first dim) and years (second dim)
214+
215+
* rcps: list of strings referring to RCPs 2.6, 4.5, 6.0 and 8.5
216+
* gmst_start_year: integer with the GMST data starting year, 1880
217+
* gmst_end_year: integer with the GMST data ending year, 2100
218+
* gmst_data: array with GMST data across RCPs (first dim) and years (second dim)
214219
"""
215220

216221
gmst_data = np.array(

climada/hazard/tc_tracks.py

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -199,27 +199,31 @@ class TCTracks:
199199
----------
200200
data : list(xarray.Dataset)
201201
List of tropical cyclone tracks. Each track contains following attributes:
202-
- time (coords)
203-
- lat (coords)
204-
- lon (coords)
205-
- time_step (in hours)
206-
- radius_max_wind (in nautical miles)
207-
- radius_oci (in nautical miles)
208-
- max_sustained_wind (in knots)
209-
- central_pressure (in hPa/mbar)
210-
- environmental_pressure (in hPa/mbar)
211-
- basin (for each track position)
212-
- max_sustained_wind_unit (attrs)
213-
- central_pressure_unit (attrs)
214-
- name (attrs)
215-
- sid (attrs)
216-
- orig_event_flag (attrs)
217-
- data_provider (attrs)
218-
- id_no (attrs)
219-
- category (attrs)
202+
203+
* time (coords)
204+
* lat (coords)
205+
* lon (coords)
206+
* time_step (in hours)
207+
* radius_max_wind (in nautical miles)
208+
* radius_oci (in nautical miles)
209+
* max_sustained_wind (in knots)
210+
* central_pressure (in hPa/mbar)
211+
* environmental_pressure (in hPa/mbar)
212+
* basin (for each track position)
213+
* max_sustained_wind_unit (attrs)
214+
* central_pressure_unit (attrs)
215+
* name (attrs)
216+
* sid (attrs)
217+
* orig_event_flag (attrs)
218+
* data_provider (attrs)
219+
* id_no (attrs)
220+
* category (attrs)
221+
220222
Computed during processing:
221-
- on_land (bool for each track position)
222-
- dist_since_lf (in km)
223+
224+
* on_land (bool for each track position)
225+
* dist_since_lf (in km)
226+
223227
Additional data variables such as "nature" (specifiying, for each track position, whether a
224228
system is a disturbance, tropical storm, post-transition extratropical storm etc.) might be
225229
included, depending on the data source and on use cases.
@@ -1626,18 +1630,20 @@ def from_FAST(cls, folder_name: str):
16261630
the xr.array structure to ensure compatibility with CLIMADA, and calculating the central
16271631
pressure and radius of maximum wind.
16281632
1629-
Model GitHub Repository: https://github.com/linjonathan/tropical_cyclone_risk?
1630-
tab=readme-ov-file
1631-
Model Publication: https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2023MS003686
1633+
Model GitHub Repository:
1634+
https://github.com/linjonathan/tropical_cyclone_risk?tab=readme-ov-file
1635+
1636+
Model Publication:
1637+
https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2023MS003686
16321638
1633-
Parameters:
1639+
Parameters
16341640
----------
16351641
folder_name : str
16361642
Folder name from where to read files.
16371643
storm_id : int
16381644
Number of the simulated storm
16391645
1640-
Returns:
1646+
Returns
16411647
-------
16421648
tracks : TCTracks
16431649
TCTracks object with tracks data from the given directory of NetCDF files.
@@ -2947,13 +2953,15 @@ def set_category(max_sus_wind, wind_unit="kn", saffir_scale=None):
29472953
-------
29482954
category : int
29492955
Intensity of given track according to the Saffir-Simpson hurricane scale:
2950-
* -1 : tropical depression
2951-
* 0 : tropical storm
2952-
* 1 : Hurricane category 1
2953-
* 2 : Hurricane category 2
2954-
* 3 : Hurricane category 3
2955-
* 4 : Hurricane category 4
2956-
* 5 : Hurricane category 5
2956+
2957+
* -1 : tropical depression
2958+
* 0 : tropical storm
2959+
* 1 : Hurricane category 1
2960+
* 2 : Hurricane category 2
2961+
* 3 : Hurricane category 3
2962+
* 4 : Hurricane category 4
2963+
* 5 : Hurricane category 5
2964+
29572965
"""
29582966
if saffir_scale is None:
29592967
saffir_scale = SAFFIR_SIM_CAT

climada/hazard/tc_tracks_synth.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,8 @@ def _calc_land_decay(hist_tracks, land_geom, s_rel=True, check_plot=False, pool=
628628
629629
Decay is calculated for every TC category according to the formulas:
630630
631-
- wind decay = exp(-x*A)
632-
- pressure decay = S-(S-1)*exp(-x*B)
631+
* wind decay = exp(-x*A)
632+
* pressure decay = S-(S-1)*exp(-x*B)
633633
634634
Parameters
635635
----------

0 commit comments

Comments
 (0)