-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/add-missing-JRC-flood-impact-func…
…tions
- Loading branch information
Showing
56 changed files
with
7,903 additions
and
521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
[report] | ||
omit = | ||
*/climada/* | ||
*/test*/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: GitHub CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
ci: | ||
name: Petals | ||
uses: ./.github/workflows/testing.yml | ||
with: | ||
petals_branch: ${{ github.ref }} | ||
permissions: | ||
# For publishing results | ||
checks: write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: Petals Testing | ||
|
||
# 'Reusable workflow', can be triggered from other workflows | ||
on: | ||
workflow_call: | ||
inputs: | ||
petals_branch: | ||
description: Branch of CLIMADA Petals to check out | ||
type: string | ||
default: develop | ||
required: false | ||
core_branch: | ||
description: Branch of CLIMADA Core to test against | ||
type: string | ||
default: develop | ||
required: false | ||
|
||
|
||
# Use bash explicitly for being able to enter the conda environment | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
|
||
jobs: | ||
build-and-test: | ||
name: Unit Test Pipeline | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# For publishing results | ||
checks: write | ||
|
||
# Run this test for different Python versions | ||
strategy: | ||
# Do not abort other tests if only a single one fails | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.9", "3.10", "3.11"] | ||
|
||
steps: | ||
- | ||
name: Checkout Petals | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: CLIMADA-project/climada_petals | ||
path: climada_petals | ||
ref: ${{ inputs.petals_branch }} | ||
- | ||
name: Checkout Core | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: CLIMADA-project/climada_python | ||
path: climada_python | ||
ref: ${{ inputs.core_branch }} | ||
- | ||
# Store the current date to use it as cache key for the environment | ||
name: Get current date | ||
id: date | ||
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" | ||
- | ||
name: Create Environment with Mamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-name: climada_env_${{ matrix.python-version }} | ||
environment-file: climada_python/requirements/env_climada.yml | ||
# NOTE: Might be able to give second spec file in create-args in future | ||
# micromamba version | ||
create-args: >- | ||
python=${{ matrix.python-version }} | ||
make | ||
# Persist environment for branch, Python version, single day | ||
cache-environment-key: env-${{ github.ref }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }} | ||
- | ||
name: Update Environment for Petals | ||
run: | | ||
micromamba update -n climada_env_${{ matrix.python-version }} -f climada_petals/requirements/env_climada.yml | ||
- | ||
name: Install CLIMADA Core and Petals | ||
run: | | ||
python -m pip install "./climada_python[test]" "./climada_petals" | ||
- | ||
name: Run Unit Tests | ||
working-directory: climada_petals/ | ||
run: | | ||
make unit_test | ||
- | ||
name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
with: | ||
junit_files: climada_petals/tests_xml/tests.xml | ||
check_name: "Petals / Unit Test Results (${{ matrix.python-version }})" | ||
comment_mode: "off" | ||
- | ||
name: Upload Coverage Reports | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-report-petals-unittests-py${{ matrix.python-version }} | ||
path: climada_petals/coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ | |
* Chris Fairless | ||
* Jan Wüthrich | ||
* Zélie Standhanske | ||
* Lukas Riedel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '4.0.3-dev' | ||
__version__ = '5.0.1-dev' |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
""" | ||
This file is part of CLIMADA. | ||
Copyright (C) 2017 ETH Zurich, CLIMADA contributors listed in AUTHORS. | ||
CLIMADA is free software: you can redistribute it and/or modify it under the | ||
terms of the GNU General Public License as published by the Free | ||
Software Foundation, version 3. | ||
CLIMADA is distributed in the hope that it will be useful, but WITHOUT ANY | ||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License along | ||
with CLIMADA. If not, see <https://www.gnu.org/licenses/>. | ||
--- | ||
Export functions of the GloFAS River Flood Module | ||
""" | ||
|
||
from .setup import setup_all | ||
from .river_flood_computation import RiverFloodInundation | ||
from .rf_glofas import hazard_series_from_dataset | ||
from .transform_ops import save_file |
Oops, something went wrong.