Exact reproduction of WG3 database #584
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
name: Exact reproduction of WG3 database | |
on: | |
# # Uncomment these two lines for debugging, but leave them commented on 'main' | |
# pull_request: | |
# branches: [ main ] | |
push: | |
branches: [ main ] | |
schedule: | |
# 05:00 UTC = 06:00 CET = 07:00 CEST | |
- cron: "0 5 * * *" | |
jobs: | |
ciceroscm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dev dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install -e .[tests,notebooks] | |
- name: Get infiller database | |
env: | |
SCENARIO_EXPLORER_USER: ${{ secrets.SCENARIO_EXPLORER_USER }} | |
SCENARIO_EXPLORER_PASSWORD: ${{ secrets.SCENARIO_EXPLORER_PASSWORD }} | |
INFILLER_DATABASE_NAME: "1652361598937-ar6_emissions_vetted_infillerdatabase_10.5281-zenodo.6390768.csv" | |
INFILLER_DATABASE_DIR: "data" | |
INFILLER_HASH: "30fae0530d76cbcb144f134e9ed0051f" | |
run: | | |
python -c 'import os.path; from climate_assessment.testing import _get_infiller_download_link, _file_available_or_downloaded; infiller_link = _get_infiller_download_link(os.environ.get("INFILLER_DATABASE_NAME")); _file_available_or_downloaded(os.path.join(os.environ.get("INFILLER_DATABASE_DIR"), os.environ.get("INFILLER_DATABASE_NAME")), os.environ.get("INFILLER_HASH"), infiller_link)' | |
- name: Test with pytest | |
# scenario explorer stuff needed here too so we don't skip the run with | |
# pytest | |
env: | |
SCENARIO_EXPLORER_USER: ${{ secrets.SCENARIO_EXPLORER_USER }} | |
SCENARIO_EXPLORER_PASSWORD: ${{ secrets.SCENARIO_EXPLORER_PASSWORD }} | |
run: | | |
pytest notebooks/run-example-ciceroscm.ipynb -r a --nbval-lax --no-cov | |
pytest tests/nightly/test_wg3_reproduction_ciceroscm.py -m wg3 -r a -vv | |
fair: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dev dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install -e .[tests,notebooks] | |
- name: Get infiller database | |
env: | |
SCENARIO_EXPLORER_USER: ${{ secrets.SCENARIO_EXPLORER_USER }} | |
SCENARIO_EXPLORER_PASSWORD: ${{ secrets.SCENARIO_EXPLORER_PASSWORD }} | |
INFILLER_DATABASE_NAME: "1652361598937-ar6_emissions_vetted_infillerdatabase_10.5281-zenodo.6390768.csv" | |
INFILLER_DATABASE_DIR: "data" | |
INFILLER_HASH: "30fae0530d76cbcb144f134e9ed0051f" | |
run: | |
python -c 'import os.path; from climate_assessment.testing import _get_infiller_download_link, _file_available_or_downloaded; infiller_link = _get_infiller_download_link(os.environ.get("INFILLER_DATABASE_NAME")); _file_available_or_downloaded(os.path.join(os.environ.get("INFILLER_DATABASE_DIR"), os.environ.get("INFILLER_DATABASE_NAME")), os.environ.get("INFILLER_HASH"), infiller_link)' | |
- name: Test with pytest | |
# scenario explorer stuff needed here too so we don't skip the run with | |
# pytest | |
env: | |
SCENARIO_EXPLORER_USER: ${{ secrets.SCENARIO_EXPLORER_USER }} | |
SCENARIO_EXPLORER_PASSWORD: ${{ secrets.SCENARIO_EXPLORER_PASSWORD }} | |
run: | | |
pytest notebooks/run-example-fair.ipynb -r a --nbval-lax --no-cov | |
pytest tests/nightly/test_wg3_reproduction_fair.py -m wg3 -r a -vv | |
magicc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install dev dependencies | |
run: | | |
pip install --upgrade pip wheel | |
pip install -e .[tests,notebooks] | |
- name: Get infiller database | |
env: | |
SCENARIO_EXPLORER_USER: ${{ secrets.SCENARIO_EXPLORER_USER }} | |
SCENARIO_EXPLORER_PASSWORD: ${{ secrets.SCENARIO_EXPLORER_PASSWORD }} | |
INFILLER_DATABASE_NAME: "1652361598937-ar6_emissions_vetted_infillerdatabase_10.5281-zenodo.6390768.csv" | |
INFILLER_DATABASE_DIR: "data" | |
INFILLER_HASH: "30fae0530d76cbcb144f134e9ed0051f" | |
run: | |
python -c 'import os.path; from climate_assessment.testing import _get_infiller_download_link, _file_available_or_downloaded; infiller_link = _get_infiller_download_link(os.environ.get("INFILLER_DATABASE_NAME")); _file_available_or_downloaded(os.path.join(os.environ.get("INFILLER_DATABASE_DIR"), os.environ.get("INFILLER_DATABASE_NAME")), os.environ.get("INFILLER_HASH"), infiller_link)' | |
- name: Download MAGICC | |
env: | |
MAGICC_RUN_DIR: bin/magicc/magicc-v7.5.3/run/ | |
run: | | |
mkdir -p bin/magicc/magicc-v7.5.3 | |
wget -O "bin/magicc/magicc-v7.5.3.tar.gz" "${{ secrets.MAGICC_LINK_FROM_MAGICC_DOT_ORG }}" | |
tar -xf bin/magicc/magicc-v7.5.3.tar.gz -C bin/magicc/magicc-v7.5.3 | |
mkdir -p data/magicc-drawnsets | |
wget -O "data/magicc-drawnsets/magicc-ar6-0fd0f62-f023edb-drawnset.tar.gz" "${{ secrets.MAGICC_PROB_DISTRIBUTION_LINK_FROM_MAGICC_DOT_ORG }}" | |
tar -xf "data/magicc-drawnsets/magicc-ar6-0fd0f62-f023edb-drawnset.tar.gz" -C data/magicc-drawnsets | |
- name: Test with pytest | |
# scenario explorer stuff needed here too so we don't skip the run with | |
# pytest | |
env: | |
SCENARIO_EXPLORER_USER: ${{ secrets.SCENARIO_EXPLORER_USER }} | |
SCENARIO_EXPLORER_PASSWORD: ${{ secrets.SCENARIO_EXPLORER_PASSWORD }} | |
MAGICC_EXECUTABLE_7: /home/runner/work/climate-assessment/climate-assessment/bin/magicc/magicc-v7.5.3/bin/magicc | |
MAGICC_LINK_FROM_MAGICC_DOT_ORG: ${{ secrets.MAGICC_LINK_FROM_MAGICC_DOT_ORG }} | |
MAGICC_PROB_DISTRIBUTION_LINK_FROM_MAGICC_DOT_ORG: ${{ secrets.MAGICC_PROB_DISTRIBUTION_LINK_FROM_MAGICC_DOT_ORG }} | |
MAGICC_WORKER_NUMBER: 4 | |
MAGICC_WORKER_ROOT_DIR: /tmp | |
MAGICC_PROBABILISTIC_FILE: data/magicc-drawnsets/0fd0f62-derived-metrics-id-f023edb-drawnset.json | |
run: | | |
pytest notebooks/run-example-magicc.ipynb -r a --nbval-lax --no-cov | |
pytest tests/nightly/test_wg3_reproduction_magicc.py -m wg3 -r a -vv |