Merge branch 'master' into master

This commit is contained in:
Fabian Neumann 2023-07-23 11:21:13 +02:00 committed by GitHub
commit 5cab4f4f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 36 deletions

View File

@ -19,7 +19,6 @@ on:
- cron: "0 5 * * TUE" - cron: "0 5 * * TUE"
env: env:
CONDA_CACHE_NUMBER: 1 # Change this value to manually reset the environment cache
DATA_CACHE_NUMBER: 2 DATA_CACHE_NUMBER: 2
jobs: jobs:
@ -27,22 +26,12 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
max-parallel: 3
matrix: matrix:
include: os:
# Matrix required to handle caching with Mambaforge - ubuntu-latest
- os: ubuntu-latest - macos-latest
label: ubuntu-latest - windows-latest
prefix: /usr/share/miniconda3/envs/pypsa-eur
- os: macos-latest
label: macos-latest
prefix: /Users/runner/miniconda3/envs/pypsa-eur
- os: windows-latest
label: windows-latest
prefix: C:\Miniconda3\envs\pypsa-eur
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -60,24 +49,25 @@ jobs:
- name: Add solver to environment - name: Add solver to environment
run: | run: |
echo -e "- glpk\n- ipopt<3.13.3" >> envs/environment.yaml echo -e "- glpk\n- ipopt<3.13.3" >> envs/environment.yaml
if: ${{ matrix.label }} == 'windows-latest' if: ${{ matrix.os }} == 'windows-latest'
- name: Add solver to environment - name: Add solver to environment
run: | run: |
echo -e "- glpk\n- ipopt" >> envs/environment.yaml echo -e "- glpk\n- ipopt" >> envs/environment.yaml
if: ${{ matrix.label }} != 'windows-latest' if: ${{ matrix.os }} != 'windows-latest'
- name: Setup Mambaforge - name: Setup micromamba
uses: conda-incubator/setup-miniconda@v2 uses: mamba-org/setup-micromamba@v1
with: with:
miniforge-variant: Mambaforge micromamba-version: latest
miniforge-version: latest environment-file: envs/environment.yaml
activate-environment: pypsa-eur log-level: debug
use-mamba: true init-shell: bash
cache-environment: true
cache-downloads: true
- name: Set cache dates - name: Set cache dates
run: | run: |
echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
echo "WEEK=$(date +'%Y%U')" >> $GITHUB_ENV echo "WEEK=$(date +'%Y%U')" >> $GITHUB_ENV
- name: Cache data and cutouts folders - name: Cache data and cutouts folders
@ -88,17 +78,6 @@ jobs:
cutouts cutouts
key: data-cutouts-${{ env.WEEK }}-${{ env.DATA_CACHE_NUMBER }} key: data-cutouts-${{ env.WEEK }}-${{ env.DATA_CACHE_NUMBER }}
- name: Create environment cache
uses: actions/cache@v3
id: cache
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ env.DATE }}-${{ env.CONDA_CACHE_NUMBER }}
- name: Update environment due to outdated or unavailable cache
run: mamba env update -n pypsa-eur -f envs/environment.yaml
if: steps.cache.outputs.cache-hit != 'true'
- name: Test snakemake workflow - name: Test snakemake workflow
run: | run: |
conda activate pypsa-eur conda activate pypsa-eur

View File

@ -224,7 +224,10 @@ The included ``.nc`` files are PyPSA network files which can be imported with Py
n = pypsa.Network(filename) n = pypsa.Network(filename)
Operating Systems
=================
The PyPSA-Eur workflow is continuously tested for Linux, macOS and Windows (WSL only).
.. toctree:: .. toctree::