Skip to content

Commit f4111b0

Browse files
Merge branch 'develop' into feature/rp_impact
2 parents 664dd6a + b8cc3c4 commit f4111b0

File tree

5 files changed

+66
-9
lines changed

5 files changed

+66
-9
lines changed

.github/workflows/pull-request.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: GitHub CI
2+
3+
# Execute this for every pull request (opened, reopened, and synchronized)
4+
on: [pull_request]
5+
6+
jobs:
7+
pre-commit-checks:
8+
name: 'Core / Pre-Commit Checks'
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
-
13+
name: Checkout Repo
14+
uses: actions/checkout@v4
15+
with:
16+
ref: ${{ github.event.pull_request.head.sha }}
17+
-
18+
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 }}
20+
-
21+
name: Set up Python 3.11
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.11'
25+
-
26+
# Store the current date to use it as cache key
27+
name: Get current date
28+
id: date
29+
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
30+
-
31+
name: Cache dependencies
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.cache/pip
36+
~/.cache/pre-commit
37+
key: ${{ github.event.pull_request.head.ref }}-${{ steps.date.outputs.date }}
38+
restore-keys: |
39+
${{ github.event.pull_request.head.ref }}
40+
${{ github.event.pull_request.base.ref }}
41+
develop
42+
main
43+
-
44+
name: Install pre-commit and hooks
45+
run: |
46+
pip install pre-commit
47+
pre-commit install --install-hooks
48+
-
49+
name: Run pre-commit checks
50+
run: pre-commit run --show-diff-on-failure --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ CLIMADA tutorials. [#872](https://github.com/CLIMADA-project/climada_python/pull
138138
### Removed
139139

140140
- climada.hazard.base.Hazard.clear
141+
- climada.hazard.base.Hazard.from_mat
141142
- climada.hazard.base.Hazard.raster_to_vector
142143
- climada.hazard.base.Hazard.read_mat
143144
- climada.hazard.base.Hazard.reproject_raster

climada/engine/impact_calc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def impact(
107107
108108
Examples
109109
--------
110-
>>> haz = Hazard.from_mat(HAZ_DEMO_MAT) # Set hazard
110+
>>> haz = Hazard.from_hdf5(HAZ_DEMO_H5) # Set hazard
111111
>>> impfset = ImpactFuncSet.from_excel(ENT_TEMPLATE_XLS)
112112
>>> exp = Exposures(pd.read_excel(ENT_TEMPLATE_XLS))
113113
>>> impcalc = ImpactCal(exp, impfset, haz)

climada/hazard/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def __init__(
184184
185185
Take hazard values from file:
186186
187-
>>> haz = Hazard.from_mat(HAZ_DEMO_MAT, 'demo')
187+
>>> haz = Hazard.from_hdf5(HAZ_DEMO_H5)
188188
189189
"""
190190
self.haz_type = haz_type

doc/guide/Guide_CLIMADA_conventions.ipynb

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,16 @@
210210
"\n",
211211
" ```shell\n",
212212
" git fetch -t\n",
213+
" git checkout develop-white\n",
214+
" git checkout develop-black\n",
213215
" ```\n",
214216
" \n",
215217
"2. Switch to your feature branch and merge `develop-white` (in order to get the latest changes in `develop` before switching to `black`):\n",
216218
"\n",
217219
" ```shell\n",
218220
" git checkout YOUR_BRANCH\n",
219221
" git pull\n",
222+
" pre-commit uninstall || pip install pre-commit\n",
220223
" git merge --no-ff develop-white\n",
221224
" ```\n",
222225
" If merge conflicts arise, resolve them and conclude the merge as instructed by Git.\n",
@@ -241,13 +244,13 @@
241244
" ```shell\n",
242245
" git merge --no-ff develop-black\n",
243246
" ```\n",
244-
" * If merge conflicts arise, resolve them and conclude the merge as instructed by Git.\n",
245-
" Most conflicts will probably be resolved by choosing \"Ours\" over \"Theirs\" or the \"Current Change\" over the \"Incoming Change\".\n",
246-
" Still, be careful!\n",
247-
" * Once all conflicts are resolved, check if the tests pass.\n",
248-
" If so, the formatting was successful.\n",
249-
" If you cannot import Climada, one of the merges inflicted erroneous syntax.\n",
250-
" You will have to fix this manually before you commit the merge.\n",
247+
" Resolve all conflicts by choosing \"Ours\" over \"Theirs\" (\"Current Change\" over the \"Incoming Change\").\n",
248+
" \n",
249+
" ```shell\n",
250+
" git checkout --ours .\n",
251+
" git add -u\n",
252+
" git commit\n",
253+
" ```\n",
251254
" \n",
252255
"6. Now, get up to date with the latest `develop` branch:\n",
253256
"\n",
@@ -258,6 +261,9 @@
258261
" git merge --no-ff develop\n",
259262
" ```\n",
260263
" Again, fix merge conflicts if they arise and check if the tests pass.\n",
264+
" Accept the incoming changes for the tutorials 1_main, Exposures, LitPop Impact, Forecast and TropicalCyclone unless you made changes to those.\n",
265+
" Again, the file with the most likely merging conflicts is CHANGELOG.md, which should probably be resolved by accepting both changes.\n",
266+
" \n",
261267
" \n",
262268
"7. Finally, push your latest changes:\n",
263269
"\n",

0 commit comments

Comments
 (0)