Skip to content

Commit 0f5be1d

Browse files
Merge branch 'develop' into feature/wisc-relocation
2 parents a9235c0 + 5f092ab commit 0f5be1d

File tree

103 files changed

+13514
-4572
lines changed

Some content is hidden

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

103 files changed

+13514
-4572
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on: [push]
66
# Use bash explicitly for being able to enter the conda environment
77
defaults:
88
run:
9-
shell: bash -l {0}
9+
shell: bash -el {0}
1010

1111
jobs:
1212
build-and-test:
13-
name: Build Env, Install, Unit Tests
13+
name: 'Core / Unit Test Pipeline'
1414
runs-on: ubuntu-latest
1515
permissions:
1616
# For publishing results
@@ -41,8 +41,6 @@ jobs:
4141
create-args: >-
4242
python=${{ matrix.python-version }}
4343
make
44-
init-shell: >-
45-
bash
4644
# Persist environment for branch, Python version, single day
4745
cache-environment-key: env-${{ github.ref }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }}
4846
-
@@ -59,12 +57,22 @@ jobs:
5957
if: always()
6058
with:
6159
junit_files: tests_xml/tests.xml
62-
check_name: "Unit Test Results Python ${{ matrix.python-version }}"
60+
check_name: "Core / Unit Test Results (${{ matrix.python-version }})"
6361
comment_mode: "off"
6462
-
6563
name: Upload Coverage Reports
6664
if: always()
6765
uses: actions/upload-artifact@v4
6866
with:
69-
name: coverage-report-unittests-py${{ matrix.python-version }}
67+
name: coverage-report-core-unittests-py${{ matrix.python-version }}
7068
path: coverage/
69+
70+
test-petals:
71+
name: Petals Compatibility
72+
uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@develop
73+
needs: build-and-test
74+
with:
75+
core_branch: ${{ github.ref }}
76+
petals_branch: develop
77+
permissions:
78+
checks: write

AUTHORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@
2929
* Raphael Portmann
3030
* Nicolas Colombi
3131
* Leonie Villiger
32+
* Timo Schmid
3233
* Kam Lam Yeung
3334
* Sarah Hülsen
3435
* Timo Schmid
3536
* Luca Severino
3637
* Samuel Juhel
38+
* Valentin Gebhart

CHANGELOG.md

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,54 @@ Code freeze date: YYYY-MM-DD
1010

1111
### Dependency Changes
1212

13+
### Added
14+
15+
- `climada.util.interpolation` module for inter- and extrapolation util functions used in local exceedance intensity and return period functions [#930](https://github.com/CLIMADA-project/climada_python/pull/930)
16+
1317
### Changed
1418

15-
- Remove content tables and make minor improvements (fix typos and readability) in
16-
CLIMADA tutorials. [#872](https://github.com/CLIMADA-project/climada_python/pull/872)
17-
- Centroids complete overhaul. Most function should be backward compatible. Internal data is stored in a geodataframe attribute. Raster are now stored as points, and the meta attribute is removed. Several methds were deprecated or removed. [#787](https://github.com/CLIMADA-project/climada_python/pull/787)
18-
- Improved error messages produced by `ImpactCalc.impact()` in case impact function in the exposures is not found in impf_set [#863](https://github.com/CLIMADA-project/climada_python/pull/863)
19+
- In `climada.util.plot.geo_im_from_array`, NaNs are plotted in gray while cells with no centroid are not plotted [#929](https://github.com/CLIMADA-project/climada_python/pull/929)
20+
- Renamed `climada.util.plot.subplots_from_gdf` to `climada.util.plot.plot_from_gdf` [#929](https://github.com/CLIMADA-project/climada_python/pull/929)
1921

2022
### Fixed
2123

22-
- Avoid an issue where a Hazard subselection would have a fraction matrix with only zeros as entries by throwing an error [#866](https://github.com/CLIMADA-project/climada_python/pull/866)
24+
### Deprecated
25+
26+
### Removed
27+
28+
## 5.0.0
29+
30+
Release date: 2024-07-19
31+
32+
### Dependency Changes
33+
34+
Added:
35+
36+
- `bayesian-optimization`
37+
- `seaborn` >=0.13
38+
39+
Updated:
40+
41+
- `bottleneck` >=1.3 → >=1.4
42+
- `cartopy` >=0.22 → >=0.23
43+
- `contextily` >=1.5 → >=1.6
44+
- `dask` >=2024.1,<2024.3 &rarr; >=2024.2,<2024.3
45+
- `matplotlib-base` >=3.8 &rarr; >=3.9
46+
- `numba` >=0.59 &rarr; >=0.60
47+
- `numexpr` >=2.9 &rarr; >=2.10
48+
- `pint` >=0.23 &rarr; >=0.24
49+
- `pycountry` >=22.3 &rarr; >=24.6
50+
- `requests` >=2.31 &rarr; >=2.32
51+
- `salib` >=1.4 &rarr; >=1.5
52+
- `scikit-learn` >=1.4 &rarr; >=1.5
53+
- `scipy` >=1.12 &rarr; >=1.13
54+
- `xarray` >=2024.2 &rarr; >=2024.6
2355

2456
### Added
2557

58+
- GitHub actions workflow for CLIMADA Petals compatibility tests [#855](https://github.com/CLIMADA-project/climada_python/pull/855)
59+
- `climada.util.calibrate` module for calibrating impact functions [#692](https://github.com/CLIMADA-project/climada_python/pull/692)
60+
- Method `Hazard.check_matrices` for bringing the stored CSR matrices into "canonical format" [#893](https://github.com/CLIMADA-project/climada_python/pull/893)
2661
- Generic s-shaped impact function via `ImpactFunc.from_poly_s_shape` [#878](https://github.com/CLIMADA-project/climada_python/pull/878)
2762
- climada.hazard.centroids.centr.Centroids.get_area_pixel
2863
- climada.hazard.centroids.centr.Centroids.get_dist_coast
@@ -33,6 +68,31 @@ CLIMADA tutorials. [#872](https://github.com/CLIMADA-project/climada_python/pull
3368
- climada.hazard.centroids.centr.Centroids.to_default_crs
3469
- climada.hazard.centroids.centr.Centroids.write_csv
3570
- climada.hazard.centroids.centr.Centroids.write_excel
71+
- climada.hazard.local_return_period [#898](https://github.com/CLIMADA-project/climada_python/pull/898)
72+
- climada.util.plot.subplots_from_gdf [#898](https://github.com/CLIMADA-project/climada_python/pull/898)
73+
74+
### Changed
75+
76+
- Use Geopandas GeoDataFrame.plot() for centroids plotting function [896](https://github.com/CLIMADA-project/climada_python/pull/896)
77+
- Update SALib sensitivity and sampling methods from newest version (SALib 1.4.7) [#828](https://github.com/CLIMADA-project/climada_python/issues/828)
78+
- Allow for computation of relative and absolute delta impacts in `CalcDeltaClimate`
79+
- Remove content tables and make minor improvements (fix typos and readability) in
80+
CLIMADA tutorials. [#872](https://github.com/CLIMADA-project/climada_python/pull/872)
81+
- Centroids complete overhaul. Most function should be backward compatible. Internal data is stored in a geodataframe attribute. Raster are now stored as points, and the meta attribute is removed. Several methds were deprecated or removed. [#787](https://github.com/CLIMADA-project/climada_python/pull/787)
82+
- Improved error messages produced by `ImpactCalc.impact()` in case impact function in the exposures is not found in impf_set [#863](https://github.com/CLIMADA-project/climada_python/pull/863)
83+
- Update the Holland et al. 2010 TC windfield model and introduce `model_kwargs` parameter to adjust model parameters [#846](https://github.com/CLIMADA-project/climada_python/pull/846)
84+
- Changed module structure: `climada.hazard.Hazard` has been split into the modules `base`, `io` and `plot` [#871](https://github.com/CLIMADA-project/climada_python/pull/871)
85+
- Ensure `csr_matrix` stored in `climada.hazard.Hazard` have consistent data format and store no explicit zeros when initializing `ImpactCalc` [#893](https://github.com/CLIMADA-project/climada_python/pull/893)
86+
- `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)
87+
- `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)
88+
- Split `climada.hazard.trop_cyclone` module into smaller submodules without affecting module usage [#911](https://github.com/CLIMADA-project/climada_python/pull/911)
89+
90+
### Fixed
91+
92+
- Avoid an issue where a Hazard subselection would have a fraction matrix with only zeros as entries by throwing an error [#866](https://github.com/CLIMADA-project/climada_python/pull/866)
93+
- Allow downgrading the Python bugfix version to improve environment compatibility [#900](https://github.com/CLIMADA-project/climada_python/pull/900)
94+
- Fix broken links in `CONTRIBUTING.md` [#900](https://github.com/CLIMADA-project/climada_python/pull/900)
95+
- When writing `TCTracks` to NetCDF, only apply compression to `float` or `int` data types. This fixes a downstream issue, see [climada_petals#135](https://github.com/CLIMADA-project/climada_petals/issues/135) [#911](https://github.com/CLIMADA-project/climada_python/pull/911)
3696

3797
### Deprecated
3898

@@ -43,6 +103,7 @@ CLIMADA tutorials. [#872](https://github.com/CLIMADA-project/climada_python/pull
43103
- climada.hazard.centroids.centr.Centroids.empty_geometry_points
44104
- climada.hazard.centroids.centr.Centroids.set_meta_to_lat_lon
45105
- climada.hazard.centroids.centr.Centroids.set_lat_lon_to_meta
106+
- `scheduler` parameter in `climada.util.coordinates.set_df_geometry_points`, as dask is not used anymore, leaving all calculation to shapely [#912](https://github.com/CLIMADA-project/climada_python/pull/912)
46107

47108
### Removed
48109

@@ -153,6 +214,7 @@ Changed:
153214

154215
- `geopandas` >=0.13 &rarr; >=0.14
155216
- `pandas` >=1.5,<2.0 &rarr; >=2.1
217+
- `salib` >=1.3.0 &rarr; >=1.4.7
156218

157219
Removed:
158220

CONTRIBUTING.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Please contact the [lead developers](https://wcr.ethz.ch/research/climada.html)
2222

2323
## Minimal Steps to Contribute
2424

25-
Before you start, please have a look at our [Developer Guide][devguide].
25+
Before you start, please have a look at our Developer Guide section in the [CLIMADA Docs][docs].
2626

2727
To contribute follow these steps:
2828

@@ -65,21 +65,22 @@ To contribute follow these steps:
6565
6666
## Resources
6767
68-
The CLIMADA documentation provides a [Developer Guide][devguide].
68+
The [CLIMADA documentation][docs] provides several Developer Guides.
6969
Here's a selection of the commonly required information:
7070

7171
* How to use Git and GitHub for CLIMADA development: [Development and Git and CLIMADA](https://climada-python.readthedocs.io/en/latest/guide/Guide_Git_Development.html)
72-
* Coding instructions for CLIMADA: [Python Dos and Don'ts](https://climada-python.readthedocs.io/en/latest/guide/Guide_PythonDos-n-Donts.html), [Performance Tips](https://climada-python.readthedocs.io/en/latest/guide/Guide_Py_Performance.html), [CLIMADA Conventions](https://climada-python.readthedocs.io/en/latest/guide/Guide_Miscellaneous.html)
73-
* How to execute tests in CLIMADA: [Testing and Continuous Integration][testing]
72+
* Coding instructions for CLIMADA: [Python Dos and Don'ts](https://climada-python.readthedocs.io/en/latest/guide/Guide_PythonDos-n-Donts.html), [Performance Tips](https://climada-python.readthedocs.io/en/latest/guide/Guide_Py_Performance.html), [CLIMADA Conventions](https://climada-python.readthedocs.io/en/latest/guide/Guide_CLIMADA_conventions.html)
73+
* How to execute tests in CLIMADA: [Testing][testing] and [Continuous Integration](https://climada-python.readthedocs.io/en/latest/guide/Guide_continuous_integration_GitHub_actions.html)
7474
7575
## Pull Requests
7676
7777
After developing a new feature, fixing a bug, or updating the tutorials, you can create a [pull request](https://docs.github.com/en/pull-requests) to have your changes reviewed and then merged into the CLIMADA code base.
7878
To ensure that your pull request can be reviewed quickly and easily, please have a look at the _Resources_ above before opening a pull request.
79-
In particular, please check out the [Pull Request instructions](https://climada-python.readthedocs.io/en/latest/guide/Guide_Git_Development.html#Pull-requests).
79+
In particular, please check out the [Pull Request instructions](https://climada-python.readthedocs.io/en/latest/guide/Guide_Git_Development.html#pull-requests).
8080
8181
We provide a description template for pull requests that helps you provide the essential information for reviewers.
8282
It also contains a checklist for both pull request authors and reviewers to guide the review process.
8383
84+
[docs]: https://climada-python.readthedocs.io/en/latest/
8485
[devguide]: https://climada-python.readthedocs.io/en/latest/#developer-guide
85-
[testing]: https://climada-python.readthedocs.io/en/latest/guide/Guide_Continuous_Integration_and_Testing.html
86+
[testing]: https://climada-python.readthedocs.io/en/latest/guide/Guide_Testing.html

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
PYTEST_JUNIT_ARGS = --junitxml=tests_xml/tests.xml
66

77
PYTEST_COV_ARGS = \
8-
--cov --cov-config=.coveragerc --cov-report html --cov-report xml \
9-
--cov-report term:skip-covered
8+
--cov --cov-config=.coveragerc --cov-report html:coverage \
9+
--cov-report xml:coverage.xml --cov-report term:skip-covered
1010

1111
PYTEST_ARGS = $(PYTEST_JUNIT_ARGS) $(PYTEST_COV_ARGS)
1212

climada/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '4.1.2-dev'
1+
__version__ = '5.0.1-dev'

climada/conf/climada.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"cache_db": "{local_data.system}/.downloads.db",
6868
"cache_enabled": true,
6969
"cache_dir": "{local_data.system}/.apicache",
70-
"supported_hazard_types": ["river_flood", "tropical_cyclone", "storm_europe", "relative_cropyield", "wildfire", "earthquake", "flood", "hail"],
70+
"supported_hazard_types": ["river_flood", "tropical_cyclone", "storm_europe", "relative_cropyield", "wildfire", "earthquake", "flood", "hail", "aqueduct_coastal_flood"],
7171
"supported_exposures_types": ["litpop", "crop_production", "ssp_population", "crops"]
7272
}
7373
}

climada/engine/forecast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def __init__(
186186
if exposure_name is None:
187187
try:
188188
self.exposure_name = u_coord.country_to_iso(
189-
exposure.gdf.region_id.unique()[0], "name"
189+
exposure.gdf["region_id"].unique()[0], "name"
190190
)
191191
except (KeyError, AttributeError):
192192
self.exposure_name = "custom"

0 commit comments

Comments
 (0)