Skip to content

Commit 741fb71

Browse files
committed
Merge branch 'master' of https://github.com/Timon-R/pypsa-eur
2 parents 719515d + c852b9a commit 741fb71

202 files changed

Lines changed: 11905 additions & 7090 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Bug Report
2+
description: Create a report if something doesn't work quite right.
3+
labels: ["needs triage"]
4+
type: "Bug"
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
Thanks for taking the time to fill out this bug report!
11+
Please do not post usage questions here. Ask them on the [PyPSA Discord server](https://discord.gg/AnuJBk23FU).
12+
13+
- type: checkboxes
14+
id: checks
15+
attributes:
16+
label: Version Checks (indicate both or one)
17+
options:
18+
- label: >
19+
I have confirmed this bug exists on the lastest
20+
[release](https://github.com/pypsa/pypsa-eur/releases) of PyPSA-Eur.
21+
- label: >
22+
I have confirmed this bug exists on the current
23+
[`master`](https://github.com/pypsa/pypsa-eur/tree/master) branch of PyPSA-Eur.
24+
25+
- type: textarea
26+
id: problem
27+
attributes:
28+
label: Issue Description
29+
description: >
30+
Please provide a description of the issue.
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
id: example
36+
validations:
37+
required: true
38+
attributes:
39+
label: Reproducible Example
40+
description: >
41+
Please provide a minimal reproduciable example. See how to [craft minimal bug reports](https://matthewrocklin.com/minimal-bug-reports).
42+
placeholder: >
43+
...
44+
45+
render: python
46+
47+
- type: textarea
48+
id: expected-behavior
49+
validations:
50+
required: true
51+
attributes:
52+
label: Expected Behavior
53+
description: >
54+
Please describe or show a code example of the expected behavior.
55+
56+
- type: textarea
57+
id: version
58+
attributes:
59+
label: Installed Versions
60+
description: >
61+
Please share information on your environment. Paste the output below. For conda ``conda env export`` and for pip ``pip freeze``.
62+
value: >
63+
<details>
64+
65+
Replace this line.
66+
67+
</details>
68+

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
name: Feature request
2+
name: Feature Request
33
about: Suggest an idea for this project
44
title: ''
5-
labels: enhancement
5+
labels: ["needs triage"]
6+
type: 'Feature'
67
assignees: ''
78

89
---
910

10-
<!-- Please do not post usage questions here. Ask them on the PyPSA mailing list: https://groups.google.com/forum/#!forum/pypsa -->
11+
<!-- Please do not post usage questions here. Ask them on the PyPSA Discord server: https://discord.gg/AnuJBk23FU -->
1112

1213
## Describe the feature you'd like to see
1314

.github/workflows/push-images.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Push images
2+
3+
on:
4+
push:
5+
6+
branches:
7+
- master
8+
workflow_dispatch:
9+
10+
env:
11+
IMAGE_NAME: pypsa/eur-dev-env
12+
BASE_ENV: envs/linux-pinned.yaml
13+
14+
jobs:
15+
push-image:
16+
name: dev-env
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: 'Get relevant env'
24+
run: |
25+
hash_last_changed=$(git log -1 --pretty=format:%H -- ${{ env.BASE_ENV }})
26+
echo "hash_last_changed=$hash_last_changed" >> $GITHUB_ENV
27+
28+
- name: 'Login to GitHub Container Registry'
29+
uses: docker/login-action@v3
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.repository_owner }}
33+
password: ${{ secrets.REGISTRY_TOKEN }}
34+
35+
- name: 'Build new image' # only build if the pinned envs file was modified
36+
if: env.hash_last_changed == github.sha || github.event_name == 'workflow_dispatch'
37+
run: |
38+
docker build . --file docker/dev-env/Dockerfile --tag ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }}
39+
docker push ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }}
40+
41+
# Add latest tag if on main branch
42+
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
43+
docker tag ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }} ghcr.io/${{ env.IMAGE_NAME }}:latest
44+
docker push ghcr.io/${{ env.IMAGE_NAME }}:latest
45+
fi
46+
47+
- name: 'Add SHA tag to existing image' # when rebuild is not needed
48+
if: env.hash_last_changed != github.sha
49+
run: |-
50+
docker pull ghcr.io/${{ env.IMAGE_NAME }}:${{ env.hash_last_changed }}
51+
docker tag ghcr.io/${{ env.IMAGE_NAME }}:${{ env.hash_last_changed }} ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }}
52+
docker push ghcr.io/${{ env.IMAGE_NAME }}:${{ github.sha }}

.github/workflows/test.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# SPDX-FileCopyrightText: Contributors to PyPSA-Eur <https://github.com/pypsa/pypsa-eur>
2-
#
3-
# SPDX-License-Identifier: CC0-1.0
4-
51
name: Test workflows
62

73
on:
@@ -14,6 +10,7 @@ on:
1410
schedule:
1511
- cron: "0 5 * * 1-6"
1612
- cron: "0 5 * * 0"
13+
workflow_dispatch:
1714

1815
# Cancel any in-progress runs when a new run is triggered
1916
concurrency:
@@ -73,7 +70,9 @@ jobs:
7370

7471
- uses: conda-incubator/setup-miniconda@v3
7572
with:
73+
miniforge-version: latest
7674
activate-environment: pypsa-eur
75+
channel-priority: strict
7776

7877
- name: Cache Conda env
7978
uses: actions/cache@v4
@@ -88,6 +87,11 @@ jobs:
8887
conda env update -n pypsa-eur -f ${{ env.env_file }}
8988
echo "Run conda list" && conda list
9089
90+
- name: Run pylint check on scripts
91+
# check for undefined variables to reuse functions across scripts
92+
run: |
93+
pylint --disable=all --enable=E0601,E0606 --output-format=parseable scripts/add_* scripts/prepare_* scripts/solve_*
94+
9195
- name: Run snakemake test workflows
9296
run: |
9397
make test

.github/workflows/update-pinned-env.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ jobs:
3434
- name: Setup conda
3535
uses: conda-incubator/setup-miniconda@v3
3636
with:
37+
miniforge-version: latest
3738
activate-environment: ${{ github.event.repository.name }}
38-
channels: bioconda,conda-forge,defaults
39+
channel-priority: strict
3940
environment-file: ${{ env.BASE_ENV }}
4041

4142
- name: Update pinned environment per OS
@@ -83,5 +84,8 @@ jobs:
8384
token: ${{ secrets.GITHUB_TOKEN }}
8485
branch: update-pinned-environment
8586
title: "[github-actions.ci] Update pinned envs"
86-
body: "Automatically generated PR to update pinned environment files for Windows, macOS, and Linux."
87+
body: |
88+
Automatically generated PR to update pinned environment files for Windows, macOS, and Linux.
89+
90+
**Note: Do not merge without manual test execution. Either update the branch to trigger tests, or use `workflow_dispatch` to run tests manually. Unlike standard PRs, tests will not run automatically.**
8791
commit-message: "Update pinned environment files for all platforms"

.github/workflows/validate.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
pull_request:
55
branches:
66
- master
7-
- main
87

98
concurrency:
109
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,22 +14,36 @@ jobs:
1514
name: Run validation
1615
if: github.event.pull_request.head.repo.full_name == github.repository
1716
runs-on: self-hosted
17+
outputs:
18+
validation_failed: ${{ steps.check_validation.outputs.failed }}
1819
steps:
19-
- uses: lkstrp/pypsa-validator@v0.2.4
20+
- uses: lkstrp/pypsa-validator@v0.2.5
21+
id: validation
22+
continue-on-error: true
2023
with:
2124
step: run-self-hosted-validation
2225
env_file: envs/environment.yaml
2326
snakemake_config: config/test/config.validator.yaml
2427
env:
2528
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
- name: Check validation status
30+
id: check_validation
31+
run: |
32+
if [[ "${{ steps.validation.outcome }}" == "failure" ]]; then
33+
echo "failed=true" >> $GITHUB_OUTPUT
34+
else
35+
echo "failed=false" >> $GITHUB_OUTPUT
36+
fi
2637
2738
create-report:
2839
name: Create report
29-
if: github.event.pull_request.head.repo.full_name == github.repository
3040
needs: run-validation
41+
if: |
42+
github.event.pull_request.head.repo.full_name == github.repository &&
43+
needs.run-validation.outputs.validation_failed != 'true'
3144
runs-on: ubuntu-latest
3245
steps:
33-
- uses: lkstrp/pypsa-validator@v0.2.4
46+
- uses: lkstrp/pypsa-validator@v0.2.5
3447
with:
3548
step: create-comment
3649
snakemake_config: config/test/config.validator.yaml

0 commit comments

Comments
 (0)