Skip to content

Commit c2ede47

Browse files
committed
Merge branch 'develop' into calibrate-impact-functions
2 parents 5fdbf4e + e792768 commit c2ede47

File tree

74 files changed

+418
-181
lines changed

Some content is hidden

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

74 files changed

+418
-181
lines changed

.github/scripts/setup_devbranch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ def setup_devbranch():
104104
Just changes files, all `git` commands are in the setup_devbranch.sh file.
105105
"""
106106
main_version = get_last_version().strip('v')
107-
108-
dev_version = f"{main_version}-dev"
107+
semver = main_version.split(".")
108+
semver[-1] = f"{int(semver[-1]) + 1}-dev"
109+
dev_version = ".".join(semver)
109110

110111
update_setup(dev_version)
111112
update_version(dev_version)

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: GitHub CI
2+
3+
# Execute this for every push
4+
on: [push]
5+
6+
# Use bash explicitly for being able to enter the conda environment
7+
defaults:
8+
run:
9+
shell: bash -l {0}
10+
11+
jobs:
12+
build-and-test:
13+
name: Build Env, Install, Unit Tests
14+
runs-on: ubuntu-latest
15+
permissions:
16+
# For publishing results
17+
checks: write
18+
19+
# Run this test for different Python versions
20+
strategy:
21+
# Do not abort other tests if only a single one fails
22+
fail-fast: false
23+
matrix:
24+
python-version: ["3.9", "3.10", "3.11"]
25+
26+
steps:
27+
-
28+
name: Checkout Repo
29+
uses: actions/checkout@v3
30+
-
31+
# Store the current date to use it as cache key for the environment
32+
name: Get current date
33+
id: date
34+
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
35+
-
36+
name: Create Environment with Mamba
37+
uses: mamba-org/setup-micromamba@v1
38+
with:
39+
environment-name: climada_env_${{ matrix.python-version }}
40+
environment-file: requirements/env_climada.yml
41+
create-args: >-
42+
python=${{ matrix.python-version }}
43+
make
44+
init-shell: >-
45+
bash
46+
# Persist environment for branch, Python version, single day
47+
cache-environment-key: env-${{ github.ref }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }}
48+
-
49+
name: Install CLIMADA
50+
run: |
51+
python -m pip install ".[test]"
52+
-
53+
name: Run Unit Tests
54+
run: |
55+
make unit_test
56+
-
57+
name: Publish Test Results
58+
uses: EnricoMi/publish-unit-test-result-action@v2
59+
if: always()
60+
with:
61+
junit_files: tests_xml/tests.xml
62+
check_name: "Unit Test Results Python ${{ matrix.python-version }}"
63+
comment_mode: "off"
64+
-
65+
name: Upload Coverage Reports
66+
if: always()
67+
uses: actions/upload-artifact@v3
68+
with:
69+
name: coverage-report-unittests-py${{ matrix.python-version }}
70+
path: coverage/

CHANGELOG.md

Lines changed: 2 additions & 0 deletions

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ install_test : ## Test installation was successful
2929

3030
.PHONY : data_test
3131
data_test : ## Test data APIs
32-
python test_data_api.py
32+
python script/jenkins/test_data_api.py
3333

3434
.PHONY : notebook_test
3535
notebook_test : ## Test notebooks in doc/tutorial
36-
python test_notebooks.py
36+
python script/jenkins/test_notebooks.py report
3737

3838
.PHONY : integ_test
3939
integ_test : ## Integration tests execution with xml reports

README.md

Lines changed: 10 additions & 18 deletions

climada/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
GSDP_DIR = SYSTEM_DIR.joinpath('GSDP')
2929

3030
REPO_DATA = {
31-
'data/system': [
31+
'climada/data/system': [
3232
ISIMIP_GPWV3_NATID_150AS,
3333
GLB_CENTROIDS_MAT,
3434
ENT_TEMPLATE_XLS,
@@ -44,12 +44,12 @@
4444
SYSTEM_DIR.joinpath('tc_impf_cal_v01_EDR.csv'),
4545
SYSTEM_DIR.joinpath('tc_impf_cal_v01_RMSF.csv'),
4646
],
47-
'data/system/GSDP': [
47+
'climada/data/system/GSDP': [
4848
GSDP_DIR.joinpath(f'{cc}_GSDP.xls')
4949
for cc in ['AUS', 'BRA', 'CAN', 'CHE', 'CHN', 'DEU', 'FRA', 'IDN', 'IND', 'JPN', 'MEX',
5050
'TUR', 'USA', 'ZAF']
5151
],
52-
'data/demo': [
52+
'climada/data/demo': [
5353
ENT_DEMO_TODAY,
5454
ENT_DEMO_FUTURE,
5555
EXP_DEMO_H5,
File renamed without changes.

0 commit comments

Comments
 (0)