Skip to content

Commit 5fdbf4e

Browse files
committed
Merge branch 'develop' into calibrate-impact-functions
2 parents 185866f + 4785275 commit 5fdbf4e

Some content is hidden

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

46 files changed

+2432
-2486
lines changed

.github/scripts/make_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
"""This script is part of the GitHub CI make-release pipeline
33
4-
It reads the version number from climada/_version.py and then uses the `gh` cli
4+
It reads the version number from climada*/_version.py and then uses the `gh` cli
55
to create the new release.
66
77
"""

.github/scripts/prepare_release.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,11 @@ def bump_version_number(version_number: str, level: str) -> str:
3939
major, minor, patch = version_number.split(".")
4040
if level == "major":
4141
major = str(int(major)+1)
42+
minor = "0"
43+
patch = "0"
4244
elif level == "minor":
4345
minor = str(int(minor)+1)
46+
patch = "0"
4447
elif level == "patch":
4548
patch = str(int(patch)+1)
4649
else:
@@ -111,7 +114,7 @@ def update_changelog(nvn):
111114
if "release date: " in line.lower():
112115
today = time.strftime("%Y-%m-%d")
113116
lines[i] = f"Release date: {today}"
114-
changelog.write("\n".join(lines).replace("\n\n", "\n"))
117+
changelog.write(re.sub("\n+$", "\n", "\n".join(lines)))
115118
changelog.write("\n")
116119
return GitFile('CHANGELOG.md')
117120

.github/workflows/make-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
with:
2929
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
3030
- name: Prepare new release
31-
run: .github/scripts/prepare_release.py ${{ inputs.level }}
31+
run: python .github/scripts/prepare_release.py ${{ inputs.level }}
3232
env:
3333
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
3434
- name: Publish
35-
run: .github/scripts/make_release.py
35+
run: python .github/scripts/make_release.py
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

.github/workflows/postrelease-setup-devbranch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ jobs:
1919
with:
2020
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
2121
- name: Update files
22-
run: .github/scripts/setup_devbranch.sh
22+
run: bash .github/scripts/setup_devbranch.sh
2323
env:
2424
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

CHANGELOG.md

Lines changed: 73 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,72 @@ Release date: YYYY-MM-DD
66

77
Code freeze date: YYYY-MM-DD
88

9+
### Description
10+
11+
### Dependency Changes
12+
13+
### Added
14+
15+
### Changed
16+
17+
### Fixed
18+
19+
### Deprecated
20+
21+
### Removed
22+
23+
## 4.0.0
24+
25+
Release date: 2023-09-01
26+
927
### Dependency Updates
1028

1129
Added:
1230

1331
- `pytest` [#726](https://github.com/CLIMADA-project/climada_python/pull/726)
1432
- `pytest-cov` [#726](https://github.com/CLIMADA-project/climada_python/pull/726)
1533
- `pytest-subtests` [#726](https://github.com/CLIMADA-project/climada_python/pull/726)
34+
- `unittest-xml-reporting`
1635

1736
Changed:
1837

38+
- `cartopy` >=0.20.0,<0.20.3 &rarr; >=0.21
39+
- `cfgrib` >=0.9.7,<0.9.10 &rarr; =0.9.9
40+
- `contextily` >=1.0 &rarr; >=1.3
41+
- `dask` >=2.25 &rarr; >=2023
42+
- `eccodes` [auto] &rarr; =2.27
43+
- `gdal` !=3.4.1 &rarr; >=3.6
44+
- `geopandas` >=0.8 &rarr; >=0.13
45+
- `h5py` >=2.10 &rarr; >=3.8
46+
- `haversine` >=2.3 &rarr; >=2.8
47+
- `matplotlib` >=3.2,< 3.6 &rarr; >=3.7
48+
- `netcdf4` >=1.5 &rarr; >=1.6
49+
- `numba` >=0.51,!=0.55.0 &rarr; >=0.57
50+
- `openpyxl` >=3.0 &rarr; >=3.1
51+
- `pandas-datareader` >=0.9 &rarr; >=0.10
52+
- `pathos` >=0.2 &rarr; >=0.3
53+
- `pint` >=0.15 &rarr; >=0.22
54+
- `proj` !=9.0.0 &rarr; >=9.1
55+
- `pycountry` >=20.7 &rarr; >=22.3
56+
- `pytables` >=3.6 &rarr; >=3.7
57+
- `rasterio` >=1.2.7,<1.3 &rarr; >=1.3
58+
- `requests` >=2.24 &rarr; >=2.31
59+
- `salib` >=1.3.0 &rarr; >=1.4
60+
- `scikit-learn` >=1.0 &rarr; >=1.2
61+
- `scipy` >=1.6 &rarr; >=1.10
62+
- `sparse` >=0.13 &rarr; >=0.14
63+
- `statsmodels` >=0.11 &rarr; >=0.14
64+
- `tabulate` >=0.8 &rarr; >=0.9
65+
- `tqdm` >=4.48 &rarr; >=4.65
66+
- `xarray` >=0.13 &rarr; >=2023.5
67+
- `xlrd` >=1.2 &rarr; >=2.0
68+
- `xlsxwriter` >=1.3 &rarr; >=3.1
69+
1970
Removed:
2071

2172
- `nbsphinx` [#712](https://github.com/CLIMADA-project/climada_python/pull/712)
2273
- `pandoc` [#712](https://github.com/CLIMADA-project/climada_python/pull/712)
74+
- `xmlrunner`
2375

2476
### Added
2577

@@ -29,7 +81,10 @@ Removed:
2981
- 'Extra' requirements `doc`, `test`, and `dev` for Python package [#712](https://github.com/CLIMADA-project/climada_python/pull/712)
3082
- Added method `Exposures.centroids_total_value` to replace the functionality of `Exposures.affected_total_value`. This method is temporary and deprecated. [#702](https://github.com/CLIMADA-project/climada_python/pull/702)
3183
- New method `climada.util.api_client.Client.purge_cache`: utility function to remove outdated files from the local file system to free disk space.
32-
([#737](https://github.com/CLIMADA-project/climada_python/pull/737))
84+
([#737](https://github.com/CLIMADA-project/climada_python/pull/737))
85+
- New attribute `climada.hazard.Hazard.haz_type`: used for assigning impacts to hazards. In previous versions this information was stored in the now removed `climada.hazard.tag.Tag` class. [#736](https://github.com/CLIMADA-project/climada_python/pull/736)
86+
- New attribute `climada.entity.exposures.Exposures.description`: used for setting the default title in plots from plotting mathods `plot_hexbin` and `plot_scatter`. In previous versions this information was stored in the deprecated `climada.entity.tag.Tag` class. [#756](https://github.com/CLIMADA-project/climada_python/pull/756)
87+
- Added advanced examples in unsequa tutorial for coupled input variables and for handling efficiently the loading of multiple large files [#766](https://github.com/CLIMADA-project/climada_python/pull/766)
3388

3489
### Changed
3590

@@ -50,13 +105,15 @@ Removed:
50105
- Use `pytest` for executing tests [#726](https://github.com/CLIMADA-project/climada_python/pull/726)
51106
- Users can opt-out of the climada specific logging definitions and freely configure logging to their will, by setting the config value `logging.managed` to `false`. [#724](https://github.com/CLIMADA-project/climada_python/pull/724)
52107
- Add option to read additional variables from IBTrACS when using `TCTracks.from_ibtracs_netcdf` [#728](https://github.com/CLIMADA-project/climada_python/pull/728)
53-
- The `haz_type` attribute has been moved from `climada.hazard.tag.Tag` to `climada.hazard.Hazard` itself. [#736](https://github.com/CLIMADA-project/climada_python/pull/736)
54108
- New file format for `TCTracks` I/O with better performance. This change is not backwards compatible: If you stored `TCTracks` objects with `TCTracks.write_hdf5`, reload the original data and store them again. [#735](https://github.com/CLIMADA-project/climada_python/pull/735)
55109
- Add option to load only a subset when reading TC tracks using `TCTracks.from_simulations_emanuel`. [#741](https://github.com/CLIMADA-project/climada_python/pull/741)
56110
- Set `save_mat` to `False` in the `unsequa` module [#746](https://github.com/CLIMADA-project/climada_python/pull/746)
57111
- `list_dataset_infos` from `climada.util.api_client.Client`: the `properties` argument, a `dict`, can now have `None` as values. Before, only strings and lists of strings were allowed. Setting a particular property to `None` triggers a search for datasets where this property is not assigned. [#752](https://github.com/CLIMADA-project/climada_python/pull/752)
58112
- Reduce memory requirements of `TropCyclone.from_tracks` [#749](https://github.com/CLIMADA-project/climada_python/pull/749)
59113
- Support for different wind speed and pressure units in `TCTracks` when running `TropCyclone.from_tracks` [#749](https://github.com/CLIMADA-project/climada_python/pull/749)
114+
- The title of plots created by the `Exposures` methods `plot_hexbin` and `plot_scatter` can be set as a method argument. [#756](https://github.com/CLIMADA-project/climada_python/pull/756)
115+
- Changed the parallel package from Pathos to Multiproess in the unsequa module [#763](https://github.com/CLIMADA-project/climada_python/pull/763)
116+
- Updated installation instructions to use conda for core and petals [#776](https://github.com/CLIMADA-project/climada_python/pull/776)
60117

61118
### Fixed
62119

@@ -65,18 +122,30 @@ Removed:
65122
- Correctly handle assertion errors in `Centroids.values_from_vector_files` and fix the associated test [#768](https://github.com/CLIMADA-project/climada_python/pull/768/)
66123
- Text in `Forecast` class plots can now be adjusted [#769](https://github.com/CLIMADA-project/climada_python/issues/769)
67124
- `Impact.impact_at_reg` now supports impact matrices where all entries are zero [#773](https://github.com/CLIMADA-project/climada_python/pull/773)
125+
- upgrade pathos 0.3.0 -> 0.3.1 issue [#761](https://github.com/CLIMADA-project/climada_python/issues/761) (for unsequa module [#763](https://github.com/CLIMADA-project/climada_python/pull/763))
126+
- Fix bugs with pandas 2.0 (iteritems -> items, append -> concat) (fix issue [#700](https://github.com/CLIMADA-project/climada_python/issues/700) for unsequa module) [#763](https://github.com/CLIMADA-project/climada_python/pull/763))
127+
- Remove matplotlib styles in unsequa module (fixes issue [#758](https://github.com/CLIMADA-project/climada_python/issues/758)) [#763](https://github.com/CLIMADA-project/climada_python/pull/763)
68128

69129
### Deprecated
70130

71131
- `Centroids.from_geodataframe` and `Centroids.from_pix_bounds` [#721](https://github.com/CLIMADA-project/climada_python/pull/721)
72132
- `Impact.tot_value`: Use `Exposures.affected_total_value` to compute the total value affected by a hazard intensity above a custom threshold [#702](https://github.com/CLIMADA-project/climada_python/pull/702)
73-
- `climada.hazard.tag.Tag` and `climada.entity.tag.Tag`. [#736](https://github.com/CLIMADA-project/climada_python/pull/736). They were unified into `climada.util.tag.Tag`. Note: the latter is to be deprecated and removed in a future version as well.
133+
- `climada.entity.tag.Tag`. [#779](https://github.com/CLIMADA-project/climada_python/pull/779). The class is not used anymore but had to be kept for reading Exposures HDF5 files that were created with previous versions of CLIMADA.
74134

75135
### Removed
76136

77137
- `Centroids.set_raster_from_pix_bounds` [#721](https://github.com/CLIMADA-project/climada_python/pull/721)
78138
- `requirements/env_developer.yml` environment specs. Use 'extra' requirements when installing the Python package instead [#712](https://github.com/CLIMADA-project/climada_python/pull/712)
79-
- `Impact.tag` attribute. This change is not backwards-compatible with respect to the files written and read by the `Impact` class [#743](https://github.com/CLIMADA-project/climada_python/pull/743)
139+
- The `climada.entitity.tag.Tag` class, together with `Impact.tag`, `Exposures.tag`, `ImpactFuncSet.tag`, `MeasuresSet.tag`, `Hazard.tag` attributes.
140+
This may break backwards-compatibility with respect to the files written and read by the `Impact` class.
141+
[#736](https://github.com/CLIMADA-project/climada_python/pull/736),
142+
[#743](https://github.com/CLIMADA-project/climada_python/pull/743),
143+
[#753](https://github.com/CLIMADA-project/climada_python/pull/753),
144+
[#754](https://github.com/CLIMADA-project/climada_python/pull/754),
145+
[#756](https://github.com/CLIMADA-project/climada_python/pull/756),
146+
[#767](https://github.com/CLIMADA-project/climada_python/pull/767),
147+
[#779](https://github.com/CLIMADA-project/climada_python/pull/779)
148+
- `impact.tot_value` attribute removed from unsequa module [#763](https://github.com/CLIMADA-project/climada_python/pull/763)
80149

81150
## v3.3.2
82151

@@ -104,10 +173,6 @@ Patch-relaese with altered base config file so that the basic installation test
104173

105174
Release date: 2023-02-17
106175

107-
Code freeze date: 2023-02-05
108-
109-
### Description
110-
111176
### Dependency Changes
112177

113178
new:
@@ -197,4 +262,3 @@ updated:
197262
- `climada.enginge.impact.Impact.calc()` and `climada.enginge.impact.Impact.calc_impact_yearset()`
198263
[#436](https://github.com/CLIMADA-project/climada_python/pull/436).
199264

200-
### Removed

climada/_version.py

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

climada/engine/test/test_forecast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def test_Forecast_calc_properties(self):
8181
def test_Forecast_init_raise(self):
8282
"""Test calc and propety functions from the Forecast class"""
8383
#hazard with several event dates
84-
storms = StormEurope.from_footprints(WS_DEMO_NC, description='test_description')
84+
storms = StormEurope.from_footprints(WS_DEMO_NC)
8585
#exposure
8686
data = {}
8787
data['latitude'] = np.array([1, 2, 3])

0 commit comments

Comments
 (0)