Skip to content

Commit 8fc1037

Browse files
fix merge conflicts
2 parents ad6e2c2 + 8aea89b commit 8fc1037

File tree

168 files changed

+8899
-4574
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+8899
-4574
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This is a comment.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in
5+
# the repo. Unless a later match takes precedence, they will
6+
# be requested for review when someone opens a pull request.
7+
* @emanuel-schmid @chahank @peanutfun

.github/pull_request_template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ This PR fixes #
1919
### PR Reviewer Checklist
2020

2121
- [ ] Read the [Contribution Guide][contrib]
22-
- [ ] [CLIMADA Reviewer Checklist](https://climada-python.readthedocs.io/en/latest/guide/Guide_Reviewer_Checklist.html) passed
22+
- [ ] [CLIMADA Reviewer Checklist](https://climada-python.readthedocs.io/en/latest/development/Guide_Review.html) passed
2323
- [ ] [Tests][testing] passing
2424
- [ ] No new [linter issues][linter]
2525

2626
[contrib]: https://github.com/CLIMADA-project/climada_python/blob/main/CONTRIBUTING.md
27-
[testing]: https://climada-python.readthedocs.io/en/latest/guide/Guide_Continuous_Integration_and_Testing.html
28-
[linter]: https://climada-python.readthedocs.io/en/stable/guide/Guide_Continuous_Integration_and_Testing.html#3.C.--Static-Code-Analysis
27+
[testing]: https://climada-python.readthedocs.io/en/latest/development/Guide_continuous_integration_GitHub_actions.html
28+
[linter]: https://climada-python.readthedocs.io/en/latest/development/Guide_continuous_integration_GitHub_actions.html#static-code-analysis

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# Do not abort other tests if only a single one fails
2323
fail-fast: false
2424
matrix:
25-
python-version: ["3.10", "3.11"]
25+
python-version: ["3.10", "3.11", "3.12"]
2626

2727
steps:
2828
-
@@ -47,7 +47,7 @@ jobs:
4747
-
4848
name: Install CLIMADA
4949
run: |
50-
python -m pip install ".[test]"
50+
python -m pip install "./[dev]"
5151
-
5252
name: Run Unit Tests
5353
run: |

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
ref: ${{ github.event.pull_request.head.sha }}
1717
-
1818
name: Checkout target commit
19-
run: git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{ github.event.pull_request.base.ref }}
19+
run: git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=50 origin ${{ github.event.pull_request.base.ref }}
2020
-
2121
name: Set up Python 3.11
2222
uses: actions/setup-python@v5

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,5 @@ results/
183183
!.pylintrc
184184
!.readthedocs.yml
185185
!.github
186+
climada_petals/
187+
climada_python/

.readthedocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ python:
2525

2626
formats:
2727
- pdf
28+
29+
sphinx:
30+
configuration: doc/conf.py

.zenodo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@
119119
},
120120
{
121121
"name": "Valentin Gebhart"
122+
},
123+
{
124+
"name": "Dahyann Araya"
122125
}
123126
]
124127
}

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@
3636
* Luca Severino
3737
* Samuel Juhel
3838
* Valentin Gebhart
39+
* Dahyann Araya

CHANGELOG.md

Lines changed: 124 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,52 @@ Code freeze date: YYYY-MM-DD
1010

1111
### Dependency Changes
1212

13+
Added:
14+
15+
- `fiona` >=1.10
16+
17+
Updated:
18+
19+
- `geopandas` >=0.14,<1.0 → >=0.14
20+
- `pandas` >=2.1,<2.2 → >=2.1
21+
22+
Removed:
23+
24+
- `pandas-datareader`
25+
1326
### Added
1427

28+
- Added optional parameter to `geo_im_from_array`, `plot_from_gdf`, `plot_rp_imp`, `plot_rp_intensity`,
29+
`plot_intensity`, `plot_fraction`, `_event_plot` to mask plotting when regions are too far from data points [#1047](https://github.com/CLIMADA-project/climada_python/pull/1047). To recreate previous plots (no masking), the parameter can be set to None.
30+
- Added instructions to install Climada petals on Euler cluster in `doc.guide.Guide_Euler.ipynb` [#1029](https://github.com/CLIMADA-project/climada_python/pull/1029)
31+
32+
- `ImpactFunc` and `ImpactFuncSet` now support equality comparisons via `==` [#1027](https://github.com/CLIMADA-project/climada_python/pull/1027)
33+
1534
### Changed
1635

36+
- Changed the default mask_distance in `util.plot.geo_im_from_array` to 0.03 to avoid white gaps in gridded hazard data with comparably low resolution (>80 centroids per axis) [#1073](https://github.com/CLIMADA-project/climada_python/pull/1073)
37+
- Increased speed of `util.plot.add_shapes` by avoiding for loops, substantially speeding up `Hazard.plot_intensity` and other functions. [#1073](https://github.com/CLIMADA-project/climada_python/pull/1073)
38+
- `Hazard.local_exceedance_intensity`, `Hazard.local_return_period` and `Impact.local_exceedance_impact`, `Impact.local_return_period`, using the `climada.util.interpolation` module: New default (no binning), binning on decimals, and faster implementation [#1012](https://github.com/CLIMADA-project/climada_python/pull/1012)
39+
- World Bank indicator data is now downloaded directly from their API via the function `download_world_bank_indicator`, instead of relying on the `pandas-datareader` package [#1033](https://github.com/CLIMADA-project/climada_python/pull/1033)
40+
- `Exposures.write_hdf5` pickles geometry data in WKB format, which is faster and more sustainable. [#1051](https://github.com/CLIMADA-project/climada_python/pull/1051)
41+
- The online documentation has been completely overhauled, now uses PyData theme: [#977](https://github.com/CLIMADA-project/climada_python/pull/977)
42+
- Add `climada.hazard.xarray` module with helper structures for reading Hazard objects from `xarray` data [#1063](https://github.com/CLIMADA-project/climada_python/pull/1063)
43+
1744
### Fixed
1845

46+
- NaN plotting issues in `geo_im_from_array`[#1038](https://github.com/CLIMADA-project/climada_python/pull/1038)
47+
- Broken ECMWF links in pydoc of `climada.hazard.storm_europe` relocated. [#944](https://github.com/CLIMADA-project/climada_python/pull/944)
48+
1949
### Deprecated
2050

51+
- `Hazard.from_xarray_raster_file`. Use `Hazard.from_xarray_raster` and pass the file path as `data` argument [#1063](https://github.com/CLIMADA-project/climada_python/pull/1063)
52+
2153
### Removed
2254

55+
- `climada.util.interpolation.round_to_sig_digits` [#1012](https://github.com/CLIMADA-project/climada_python/pull/1012)
56+
- `intensity_thres` of `Hazard`, `StormEurope`, and `TropCyclones` object [#1065](https://github.com/CLIMADA-project/climada_python/pull/1065)
57+
- Deprecated method `climada.hazard.trop_cyclone.trop_cyclone.TropCyclone.set_from_tracks` [#1065](https://github.com/CLIMADA-project/climada_python/pull/1065)
58+
2359
## 6.0.1
2460

2561
Release date: 2025-03-13
@@ -41,42 +77,43 @@ Added:
4177

4278
Updated:
4379

44-
- `cartopy` >=0.23 &rarr; >=0.24
45-
- `cfgrib` >=0.9.9,<0.9.10 &rarr; >=0.9
46-
- `dask` >=2024.2,<2024.3 &rarr; >=2025.2
47-
- `eccodes` >=2.27,<2.28 &rarr; >=2.40
48-
- `gdal` >=3.6 &rarr; >=3.10
49-
- `geopandas` >=0.14 &rarr; >=0.14,<1.0
50-
- `h5py` >=3.8 &rarr; >=3.12
51-
- `haversine` >=2.8 &rarr; >=2.9
52-
- `matplotlib-base` >=3.9 &rarr; >=3.10
53-
- `netcdf4` >=1.6 &rarr; >=1.7
54-
- `numba` >=0.60 &rarr; >=0.61
55-
- `pillow` =9.4 &rarr; =11.1
56-
- `pyproj` >=3.5 &rarr; >=3.7
57-
- `pytables` >=3.7 &rarr; >=3.10
58-
- `python` =3.9 &rarr; =3.11
59-
- `rasterio` >=1.3 &rarr; >=1.4
60-
- `scikit-learn` >=1.5 &rarr; >=1.6
61-
- `scipy` >=1.13 &rarr; >=1.14,<1.15
62-
- `tqdm` >=4.66 &rarr; >=4.67
63-
- `xarray` >=2024.6 &rarr; >=2025.1
64-
- `xlsxwriter` >=3.1 &rarr; >=3.2
80+
- `cartopy` >=0.23 >=0.24
81+
- `cfgrib` >=0.9.9,<0.9.10 >=0.9
82+
- `dask` >=2024.2,<2024.3 >=2025.2
83+
- `eccodes` >=2.27,<2.28 >=2.40
84+
- `gdal` >=3.6 >=3.10
85+
- `geopandas` >=0.14 >=0.14,<1.0
86+
- `h5py` >=3.8 >=3.12
87+
- `haversine` >=2.8 >=2.9
88+
- `matplotlib-base` >=3.9 >=3.10
89+
- `netcdf4` >=1.6 >=1.7
90+
- `numba` >=0.60 >=0.61
91+
- `pillow` =9.4 =11.1
92+
- `pyproj` >=3.5 >=3.7
93+
- `pytables` >=3.7 >=3.10
94+
- `python` =3.9 =3.11
95+
- `rasterio` >=1.3 >=1.4
96+
- `scikit-learn` >=1.5 >=1.6
97+
- `scipy` >=1.13 >=1.14,<1.15
98+
- `tqdm` >=4.66 >=4.67
99+
- `xarray` >=2024.6 >=2025.1
100+
- `xlsxwriter` >=3.1 >=3.2
65101

66102
Removed:
67103

68104
- `pyepsg`
69105

70106
### Added
71107

108+
- `climada.entity.impact_funcs.trop_cyclone.ImpfSetTropCyclone.get_impf_id_regions_per_countries` function [#1034](https://github.com/CLIMADA-project/climada_python/pull/1034)
72109
- `climada.hazard.tc_tracks.TCTracks.subset_years` function [#1023](https://github.com/CLIMADA-project/climada_python/pull/1023)
73110
-`climada.hazard.tc_tracks.compute_track_density` function, `climada.hazard.tc_tracks.compute_genesis_density` function,
74111
`climada.util.coordinates.compute_grid_cell_area` function, `climada.util.coordinates.compute_grid_cell_area_validation` function,
75112
`climada.hazard.tc_tracks.normalize_hist` function, `climada.hazard.plot.plot_track_density` function
76113
[#1003](https://github.com/CLIMADA-project/climada_python/pull/1003)
77114
-`climada.hazard.tc_tracks.TCTracks.from_FAST` function, add Australia basin (AU) [#993](https://github.com/CLIMADA-project/climada_python/pull/993)
78115
- Add `osm-flex` package to CLIMADA core [#981](https://github.com/CLIMADA-project/climada_python/pull/981)
79-
- `doc.tutorial.climada_entity_Exposures_osm.ipynb` tutorial explaining how to use `osm-flex`with CLIMADA
116+
- `doc.tutorial.climada_entity_Exposures_osm.ipynb` tutorial explaining how to use `osm-flex` with CLIMADA
80117
- `climada.util.coordinates.bounding_box_global` function [#980](https://github.com/CLIMADA-project/climada_python/pull/980)
81118
- `climada.util.coordinates.bounding_box_from_countries` function [#980](https://github.com/CLIMADA-project/climada_python/pull/980)
82119
- `climada.util.coordinates.bounding_box_from_cardinal_bounds` function [#980](https://github.com/CLIMADA-project/climada_python/pull/980)
@@ -108,8 +145,8 @@ Removed:
108145
- the _geometry_ column of the inherent `GeoDataFrame` is set up at initialization
109146
- latitude and longitude column are no longer present there (the according arrays can be retrieved as properties of the Exposures object: `exp.latitude` instead of `exp.gdf.latitude.values`).
110147
- `Exposures.gdf` has been renamed to `Exposures.data` (it still works though, as it is a property now pointing to the latter)
111-
- the `check` method does not add a default "IMPF_" column to the GeoDataFrame anymore
112-
- Updated IBTrACS version from v4.0 to v4.1 ([#976](https://github.com/CLIMADA-project/climada_python/pull/976)
148+
- the `check` method does not add a default `'IMPF_'` column to the GeoDataFrame anymore
149+
- Updated IBTrACS version from v4.0 to v4.1 [#976](https://github.com/CLIMADA-project/climada_python/pull/976)
113150
- Fix xarray future warning in TCTracks for .dims to .sizes
114151
- Fix hazard.concatenate type test for pathos pools
115152

@@ -143,20 +180,20 @@ Added:
143180

144181
Updated:
145182

146-
- `bottleneck` >=1.3 &rarr; >=1.4
147-
- `cartopy` >=0.22 &rarr; >=0.23
148-
- `contextily` >=1.5 &rarr; >=1.6
149-
- `dask` >=2024.1,<2024.3 &rarr; >=2024.2,<2024.3
150-
- `matplotlib-base` >=3.8 &rarr; >=3.9
151-
- `numba` >=0.59 &rarr; >=0.60
152-
- `numexpr` >=2.9 &rarr; >=2.10
153-
- `pint` >=0.23 &rarr; >=0.24
154-
- `pycountry` >=22.3 &rarr; >=24.6
155-
- `requests` >=2.31 &rarr; >=2.32
156-
- `salib` >=1.4 &rarr; >=1.5
157-
- `scikit-learn` >=1.4 &rarr; >=1.5
158-
- `scipy` >=1.12 &rarr; >=1.13
159-
- `xarray` >=2024.2 &rarr; >=2024.6
183+
- `bottleneck` >=1.3 >=1.4
184+
- `cartopy` >=0.22 >=0.23
185+
- `contextily` >=1.5 >=1.6
186+
- `dask` >=2024.1,<2024.3 >=2024.2,<2024.3
187+
- `matplotlib-base` >=3.8 >=3.9
188+
- `numba` >=0.59 >=0.60
189+
- `numexpr` >=2.9 >=2.10
190+
- `pint` >=0.23 >=0.24
191+
- `pycountry` >=22.3 >=24.6
192+
- `requests` >=2.31 >=2.32
193+
- `salib` >=1.4 >=1.5
194+
- `scikit-learn` >=1.4 >=1.5
195+
- `scipy` >=1.12 >=1.13
196+
- `xarray` >=2024.2 >=2024.6
160197

161198
### Added
162199

@@ -191,6 +228,8 @@ CLIMADA tutorials. [#872](https://github.com/CLIMADA-project/climada_python/pull
191228
- `Impact.from_hdf5` now calls `str` on `event_name` data that is not strings, and issue a warning then [#894](https://github.com/CLIMADA-project/climada_python/pull/894)
192229
- `Impact.write_hdf5` now throws an error if `event_name` is does not contain strings exclusively [#894](https://github.com/CLIMADA-project/climada_python/pull/894)
193230
- Split `climada.hazard.trop_cyclone` module into smaller submodules without affecting module usage [#911](https://github.com/CLIMADA-project/climada_python/pull/911)
231+
- `yearly_steps` parameter of `TropCyclone.apply_climate_scenario_knu` has been made explicit [#991](https://github.com/CLIMADA-project/climada_python/pull/991)
232+
- `Hazard.write_hdf5` writes centroids as x,y columns (or as wkb in case of polygons) at a compression level of 9, not as pickled `Shapely` objects anymore, which reduces the size of the files significantly.
194233

195234
### Fixed
196235

@@ -261,17 +300,17 @@ Added:
261300

262301
Updated:
263302

264-
- `contextily` >=1.3 &rarr; >=1.5
265-
- `dask` >=2023 &rarr; >=2024
266-
- `numba` >=0.57 &rarr; >=0.59
267-
- `pandas` >=2.1 &rarr; >=2.1,<2.2
268-
- `pint` >=0.22 &rarr; >=0.23
269-
- `scikit-learn` >=1.3 &rarr; >=1.4
270-
- `scipy` >=1.11 &rarr; >=1.12
271-
- `sparse` >=0.14 &rarr; >=0.15
272-
- `xarray` >=2023.8 &rarr; >=2024.1
273-
- `overpy` =0.6 &rarr; =0.7
274-
- `peewee` =3.16.3 &rarr; =3.17.1
303+
- `contextily` >=1.3 >=1.5
304+
- `dask` >=2023 >=2024
305+
- `numba` >=0.57 >=0.59
306+
- `pandas` >=2.1 >=2.1,<2.2
307+
- `pint` >=0.22 >=0.23
308+
- `scikit-learn` >=1.3 >=1.4
309+
- `scipy` >=1.11 >=1.12
310+
- `sparse` >=0.14 >=0.15
311+
- `xarray` >=2023.8 >=2024.1
312+
- `overpy` =0.6 =0.7
313+
- `peewee` =3.16.3 =3.17.1
275314

276315
Removed:
277316

@@ -280,7 +319,7 @@ Removed:
280319
### Added
281320

282321
- Convenience method `api_client.Client.get_dataset_file`, combining `get_dataset_info` and `download_dataset`, returning a single file objet. [#821](https://github.com/CLIMADA-project/climada_python/pull/821)
283-
- Read and Write methods to and from csv files for the `DiscRates` class. [#818](ttps://github.com/CLIMADA-project/climada_python/pull/818)
322+
- Read and Write methods to and from csv files for the `DiscRates` class. [#818](https://github.com/CLIMADA-project/climada_python/pull/818)
284323
- Add `CalcDeltaClimate` to unsequa module to allow uncertainty and sensitivity analysis of impact change calculations [#844](https://github.com/CLIMADA-project/climada_python/pull/844)
285324
- Add function `safe_divide` in util which handles division by zero and NaN values in the numerator or denominator [#844](https://github.com/CLIMADA-project/climada_python/pull/844)
286325
- Add reset_frequency option for the impact.select() function. [#847](https://github.com/CLIMADA-project/climada_python/pull/847)
@@ -314,13 +353,13 @@ Release date: 2023-09-27
314353

315354
Added:
316355

317-
- `matplotlib-base` None &rarr; >=3.8
356+
- `matplotlib-base` None >=3.8
318357

319358
Changed:
320359

321-
- `geopandas` >=0.13 &rarr; >=0.14
322-
- `pandas` >=1.5,<2.0 &rarr; >=2.1
323-
- `salib` >=1.3.0 &rarr; >=1.4.7
360+
- `geopandas` >=0.13 >=0.14
361+
- `pandas` >=1.5,<2.0 >=2.1
362+
- `salib` >=1.3.0 >=1.4.7
324363

325364
Removed:
326365

@@ -349,37 +388,37 @@ Added:
349388

350389
Changed:
351390

352-
- `cartopy` >=0.20.0,<0.20.3 &rarr; >=0.21
353-
- `cfgrib` >=0.9.7,<0.9.10 &rarr; =0.9.9
354-
- `contextily` >=1.0 &rarr; >=1.3
355-
- `dask` >=2.25 &rarr; >=2023
356-
- `eccodes` [auto] &rarr; =2.27
357-
- `gdal` !=3.4.1 &rarr; >=3.6
358-
- `geopandas` >=0.8 &rarr; >=0.13
359-
- `h5py` >=2.10 &rarr; >=3.8
360-
- `haversine` >=2.3 &rarr; >=2.8
361-
- `matplotlib` >=3.2,< 3.6 &rarr; >=3.7
362-
- `netcdf4` >=1.5 &rarr; >=1.6
363-
- `numba` >=0.51,!=0.55.0 &rarr; >=0.57
364-
- `openpyxl` >=3.0 &rarr; >=3.1
365-
- `pandas-datareader` >=0.9 &rarr; >=0.10
366-
- `pathos` >=0.2 &rarr; >=0.3
367-
- `pint` >=0.15 &rarr; >=0.22
368-
- `proj` !=9.0.0 &rarr; >=9.1
369-
- `pycountry` >=20.7 &rarr; >=22.3
370-
- `pytables` >=3.6 &rarr; >=3.7
371-
- `rasterio` >=1.2.7,<1.3 &rarr; >=1.3
372-
- `requests` >=2.24 &rarr; >=2.31
373-
- `salib` >=1.3.0 &rarr; >=1.4
374-
- `scikit-learn` >=1.0 &rarr; >=1.2
375-
- `scipy` >=1.6 &rarr; >=1.10
376-
- `sparse` >=0.13 &rarr; >=0.14
377-
- `statsmodels` >=0.11 &rarr; >=0.14
378-
- `tabulate` >=0.8 &rarr; >=0.9
379-
- `tqdm` >=4.48 &rarr; >=4.65
380-
- `xarray` >=0.13 &rarr; >=2023.5
381-
- `xlrd` >=1.2 &rarr; >=2.0
382-
- `xlsxwriter` >=1.3 &rarr; >=3.1
391+
- `cartopy` >=0.20.0,<0.20.3 >=0.21
392+
- `cfgrib` >=0.9.7,<0.9.10 =0.9.9
393+
- `contextily` >=1.0 >=1.3
394+
- `dask` >=2.25 >=2023
395+
- `eccodes` [auto] =2.27
396+
- `gdal` !=3.4.1 >=3.6
397+
- `geopandas` >=0.8 >=0.13
398+
- `h5py` >=2.10 >=3.8
399+
- `haversine` >=2.3 >=2.8
400+
- `matplotlib` >=3.2,< 3.6 >=3.7
401+
- `netcdf4` >=1.5 >=1.6
402+
- `numba` >=0.51,!=0.55.0 >=0.57
403+
- `openpyxl` >=3.0 >=3.1
404+
- `pandas-datareader` >=0.9 >=0.10
405+
- `pathos` >=0.2 >=0.3
406+
- `pint` >=0.15 >=0.22
407+
- `proj` !=9.0.0 >=9.1
408+
- `pycountry` >=20.7 >=22.3
409+
- `pytables` >=3.6 >=3.7
410+
- `rasterio` >=1.2.7,<1.3 >=1.3
411+
- `requests` >=2.24 >=2.31
412+
- `salib` >=1.3.0 >=1.4
413+
- `scikit-learn` >=1.0 >=1.2
414+
- `scipy` >=1.6 >=1.10
415+
- `sparse` >=0.13 >=0.14
416+
- `statsmodels` >=0.11 >=0.14
417+
- `tabulate` >=0.8 >=0.9
418+
- `tqdm` >=4.48 >=4.65
419+
- `xarray` >=0.13 >=2023.5
420+
- `xlrd` >=1.2 >=2.0
421+
- `xlsxwriter` >=1.3 >=3.1
383422

384423
Removed:
385424

0 commit comments

Comments
 (0)