Skip to content

Commit 60d3957

Browse files
authored
Merge pull request #1254 from CLIMADA-project/feature/docbuild-fixes
Removes readthedoc_ext.readthedoc extensions
2 parents 8895be3 + b9c1e2b commit 60d3957

7 files changed

Lines changed: 73 additions & 73 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Code freeze date: YYYY-MM-DD
2525

2626
### Removed
2727
- `climada.util.earth_engine.py` Google Earth Engine methods did not facilitate direct use of GEE data in CLIMADA. Code was relocated to [climada-snippets](https://github.com/CLIMADA-project/climada-snippets). [#1109](https://github.com/CLIMADA-project/climada_python/pull/1109)
28-
- `doc.climada_util_earth_engine.ipynb` Tutorial about GEE not relevant to CLIMADA Core. Tutorial notebook was relocated to [climada-snippets](https://github.com/CLIMADA-project/climada-snippets).[#1109](https://github.com/CLIMADA-project/climada_python/pull/1109)
28+
- `doc.climada_util_earth_engine.ipynb` Tutorial about GEE not relevant to CLIMADA Core. Tutorial notebook was relocated to [climada-snippets](https://github.com/CLIMADA-project/climada-snippets). [#1109](https://github.com/CLIMADA-project/climada_python/pull/1109)
2929

3030
## 6.1.0
3131

@@ -158,9 +158,9 @@ Removed:
158158
- `climada.entity.impact_funcs.trop_cyclone.ImpfSetTropCyclone.get_impf_id_regions_per_countries` function [#1034](https://github.com/CLIMADA-project/climada_python/pull/1034)
159159
- `climada.hazard.tc_tracks.BasinBoundsStorm` Enum class `climada.hazard.tc_tracks.subset_by_basin` function [#1031](https://github.com/CLIMADA-project/climada_python/pull/1031)
160160
- `climada.hazard.tc_tracks.TCTracks.subset_years` function [#1023](https://github.com/CLIMADA-project/climada_python/pull/1023)
161-
-`climada.hazard.tc_tracks.compute_track_density` function, `climada.hazard.tc_tracks.compute_genesis_density` function, `climada.hazard.plot.plot_track_density` function
161+
- `climada.hazard.tc_tracks.compute_track_density` function, `climada.hazard.tc_tracks.compute_genesis_density` function, `climada.hazard.plot.plot_track_density` function
162162
[#1003](https://github.com/CLIMADA-project/climada_python/pull/1003)
163-
-`climada.hazard.tc_tracks.TCTracks.from_FAST` function, add Australia basin (AU) [#993](https://github.com/CLIMADA-project/climada_python/pull/993)
163+
- `climada.hazard.tc_tracks.TCTracks.from_FAST` function, add Australia basin (AU) [#993](https://github.com/CLIMADA-project/climada_python/pull/993)
164164
- Add `osm-flex` package to CLIMADA core [#981](https://github.com/CLIMADA-project/climada_python/pull/981)
165165
- `doc.tutorial.climada_entity_Exposures_osm.ipynb` tutorial explaining how to use `osm-flex` with CLIMADA
166166
- `climada.util.coordinates.bounding_box_global` function [#980](https://github.com/CLIMADA-project/climada_python/pull/980)

climada/entity/exposures/base.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,17 @@ def assign_centroids(
647647
648648
Caution: nearest neighbourg matching can introduce serious artefacts
649649
such as:
650-
- exposure and hazard centroids with shifted grids can lead
651-
to systematically wrong assignements.
652-
- hazard centroids covering larger areas than exposures may lead
653-
to sub-optimal matching if the threshold is too large
654-
- projected crs often diverge at the anti-meridian and close points
655-
on either side will be at a large distance. For proper handling
656-
of the anti-meridian please use degree coordinates in EPSG:4326.
657-
This might be relevant for countries like the Fidji or the US that
658-
cross the anti-meridian.
650+
651+
- exposure and hazard centroids with shifted grids can lead
652+
to systematically wrong assignements.
653+
- hazard centroids covering larger areas than exposures may lead
654+
to sub-optimal matching if the threshold is too large
655+
- projected crs often diverge at the anti-meridian and close points
656+
on either side will be at a large distance. For proper handling
657+
of the anti-meridian please use degree coordinates in EPSG:4326.
658+
This might be relevant for countries like the Fidji or the US that
659+
cross the anti-meridian.
660+
659661
660662
Users are free to implement their own matching alrogithm and save the
661663
matching centroid index in the appropriate column ``centr_[hazard.HAZ_TYPE]``.

climada/hazard/tc_tracks.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,9 @@ def compute_track_density(
22812281
wind_min: float = None,
22822282
wind_max: float = None,
22832283
) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
2284-
"""Compute tropical cyclone track density. Before using this function,
2284+
"""Compute tropical cyclone track density.
2285+
2286+
Before using this function,
22852287
apply the same temporal resolution to all tracks by calling :py:meth:`equal_timestep` on
22862288
the TCTrack object. Due to the computational cost of the this function, it is not
22872289
recommended to use a grid resolution higher tha 0.1°. Also note that the time step (in hours)
@@ -2291,7 +2293,7 @@ def compute_track_density(
22912293
it returns the absolute count per bin. To plot the output of this function,
22922294
use :py:meth:`plot_track_density`.
22932295
2294-
Parameters:
2296+
Parameters
22952297
----------
22962298
tc_track: TCTracks object
22972299
track object containing a list of all tracks
@@ -2310,7 +2312,8 @@ def compute_track_density(
23102312
wind_max: float (optional), default: None
23112313
Maximal wind speed below which to select tracks (exclusive if wind_min is also provided,
23122314
otherwise inclusive).
2313-
Returns:
2315+
2316+
Returns
23142317
-------
23152318
hist_count: np.ndarray
23162319
2D matrix containing the absolute count per grid cell of track point.
@@ -2319,8 +2322,8 @@ def compute_track_density(
23192322
lon_bins: np.ndarray
23202323
longitude bins in which the point were counted
23212324
2322-
Example:
2323-
--------
2325+
Example
2326+
-------
23242327
>>> tc_tracks = TCTrack.from_ibtracs_netcdf("path_to_file")
23252328
>>> tc_tracks.equal_timestep(time_step_h = 1)
23262329
>>> hist_count, _, _ = compute_track_density(tc_track = tc_tracks, res = 2)

climada/util/coordinates.py

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,8 +1136,7 @@ def estimate_matching_threshold(coords_to_assign):
11361136

11371137

11381138
def degree_to_km(degree):
1139-
r"""
1140-
Convert an angle from degrees to kilometers.
1139+
r"""Convert an angle from degrees to kilometers.
11411140
11421141
This function converts a given angle in degrees to its equivalent distance in
11431142
kilometers on the Earth's surface. It assumes a spherical Earth with a constant
@@ -1160,9 +1159,11 @@ def degree_to_km(degree):
11601159
Notes
11611160
-----
11621161
The conversion is based on the formula:
1162+
11631163
.. math::
1164-
distance = angle_{radians} \\times R
1165-
where R is the Earth's radius in km.
1164+
d = a \times R
1165+
1166+
where d is the distance in km, a is the angle in radians, and R is the Earth's radius in km.
11661167
11671168
Examples
11681169
--------
@@ -1173,38 +1174,39 @@ def degree_to_km(degree):
11731174

11741175

11751176
def km_to_degree(km):
1176-
r"""
1177-
Convert a distance from kilometers to degrees.
1177+
r"""Convert a distance from kilometers to degrees.
11781178
1179-
This function converts a given distance in kilometers on the Earth's surface
1180-
to its equivalent angle in degrees. It assumes a spherical Earth with a
1181-
constant radius.
1179+
This function converts a given distance in kilometers on the Earth's surface
1180+
to its equivalent angle in degrees. It assumes a spherical Earth with a
1181+
constant radius.
11821182
1183-
Parameters
1184-
----------
1185-
km : float or array_like
1186-
The distance(s) in kilometers to convert.
1183+
Parameters
1184+
----------
1185+
km : float or array_like
1186+
The distance(s) in kilometers to convert.
11871187
1188-
Returns
1189-
-------
1190-
float or ndarray
1191-
The equivalent angle(s) in degrees.
1188+
Returns
1189+
-------
1190+
float or ndarray
1191+
The equivalent angle(s) in degrees.
11921192
1193-
See Also
1194-
--------
1195-
degree_to_km : The inverse function to convert degrees to kilometers.
1193+
See Also
1194+
--------
1195+
degree_to_km : The inverse function to convert degrees to kilometers.
1196+
1197+
Notes
1198+
-----
1199+
The conversion is based on the formula:
11961200
1197-
Notes
1198-
-----
1199-
The conversion is based on the formula:
12001201
.. math::
1201-
angle_{radians} = distance / R
1202-
where R is the Earth's radius in km.
1202+
a = d / R
12031203
1204-
Examples
1205-
--------
1206-
>>> km_to_degree(111.195)
1207-
1.0000030589140416
1204+
where a is the angle in radians, d is the distance in km, and R is the Earth's radius in km.
1205+
1206+
Examples
1207+
--------
1208+
>>> km_to_degree(111.195)
1209+
1.0000030589140416
12081210
"""
12091211
return np.rad2deg(km / EARTH_RADIUS_KM)
12101212

@@ -1412,15 +1414,17 @@ def match_centroids(
14121414
14131415
Caution: nearest neighbourg matching can introduce serious artefacts
14141416
such as:
1415-
- coordinates centroids with shifted grids can lead
1416-
to systematically wrong assignements.
1417-
- centroids covering larger areas than coordinates may lead
1418-
to sub-optimal matching if the threshold is too large
1419-
- projected crs often diverge at the anti-meridian and close points
1420-
on either side will be at a large distance. For proper handling
1421-
of the anti-meridian please use degree coordinates in EPSG:4326.
1422-
This might be relevant for countries like the Fidji or the US that
1423-
cross the anti-meridian.
1417+
1418+
- coordinates centroids with shifted grids can lead
1419+
to systematically wrong assignements.
1420+
- centroids covering larger areas than coordinates may lead
1421+
to sub-optimal matching if the threshold is too large
1422+
- projected crs often diverge at the anti-meridian and close points
1423+
on either side will be at a large distance. For proper handling
1424+
of the anti-meridian please use degree coordinates in EPSG:4326.
1425+
This might be relevant for countries like the Fidji or the US that
1426+
cross the anti-meridian.
1427+
14241428
"""
14251429

14261430
try:

doc/api/climada/climada.util.rst

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ climada\.util\.dwd\_icon\_loader module
6565
:undoc-members:
6666
:show-inheritance:
6767

68-
climada\.util\.earth\_engine module
69-
-----------------------------------
70-
71-
.. automodule:: climada.util.earth_engine
72-
:members:
73-
:undoc-members:
74-
:show-inheritance:
75-
7668
climada\.util\.files\_handler module
7769
------------------------------------
7870

@@ -97,14 +89,14 @@ climada\.util\.hdf5\_handler module
9789
:undoc-members:
9890
:show-inheritance:
9991

100-
climada\.util\.interpolation module
101-
-----------------------------------
102-
103-
.. automodule:: climada.util.interpolation
104-
:members:
105-
:undoc-members:
106-
:show-inheritance:
107-
92+
climada\.util\.interpolation module
93+
-----------------------------------
94+
95+
.. automodule:: climada.util.interpolation
96+
:members:
97+
:undoc-members:
98+
:show-inheritance:
99+
108100
climada\.util\.lines\_polys\_handler module
109101
-------------------------------------------
110102

doc/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
"sphinx_mdinclude",
4545
"myst_nb",
4646
"sphinx_markdown_tables",
47-
"readthedocs_ext.readthedocs",
4847
]
4948

5049
# read the docs version used for links

doc/getting-started/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ However, if you want to develop CLIMADA, we strongly recommend you install them.
264264

265265
With the ``climada_env`` activated, enter the workspace directory and then the CLIMADA repository as above.
266266
Then, add the ``test`` extra specification to the ``pip install`` command (**mind the quotation marks**,
267-
and see also `pip install examples <https://pip.pypa.io/en/stable/cli/pip_install/#examples>`_):
267+
and see also `pip install examples <https://pip.pypa.io/en/stable/cli/pip_install/#examples>`_):
268268

269269
.. code-block:: shell
270270

0 commit comments

Comments
 (0)