Skip to content

Commit

Permalink
Merge pull request #156 from PyPSA/lkstrp-patch-1
Browse files Browse the repository at this point in the history
Update .pre-commit-config.yaml
  • Loading branch information
lindnemi authored Aug 6, 2024
2 parents d7c98c2 + 63c83f9 commit 98a2acb
Show file tree
Hide file tree
Showing 32 changed files with 3,575 additions and 2,542 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ jobs:
strategy:
matrix:
include:
- {artifact_name: "results (feature branch)", path: "~/${{ github.repository }}/feature/results"}
- {artifact_name: "results (base branch)", path: "~/${{ github.repository }}/main/results"}
- {artifact_name: "validator-metadata", path: "~/${{ github.repository }}/validator-metadata.yml"}
- {artifact_name: "results (feature branch)", path: "~/${{ github.repository }}/feature/results"}
- {artifact_name: "results (base branch)", path: "~/${{ github.repository }}/main/results"}
- {artifact_name: "validator-metadata", path: "~/${{ github.repository }}/validator-metadata.yml"}
steps:
- name: Upload artifacts - ${{ matrix.artifact_name }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
${{ matrix.path }}
${{ matrix.path }}
if-no-files-found: error
retention-days: 90

Expand All @@ -47,17 +47,17 @@ jobs:
needs: upload-artifacts
runs-on: ubuntu-latest
steps:
- uses: lkstrp/pypsa-validator@main
with:
step: create-comment
snakemake_config: config/config.yaml
- uses: lkstrp/pypsa-validator@main
with:
step: create-comment
snakemake_config: config/config.yaml
# The path starting from prefix in config
# For plot results/<prefix>/<scenario>/<plot_name>.png pass
# <scenario>/<plot_name>.png
plots: >
"
KN2045_Bal_v4/ariadne/primary_energy.png
KN2045_Bal_v4/ariadne/secondary_energy.png
KN2045_Bal_v4/ariadne/final_energy.png
"
repo_private_key: ${{ secrets.REPO_PLOTS_PRIVATE_KEY }}
plots: >
"
KN2045_Bal_v4/ariadne/primary_energy.png
KN2045_Bal_v4/ariadne/secondary_energy.png
KN2045_Bal_v4/ariadne/final_energy.png
"
repo_private_key: ${{ secrets.REPO_PLOTS_PRIVATE_KEY }}
95 changes: 67 additions & 28 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,44 +1,83 @@
exclude: "^LICENSES"

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: mixed-line-ending
- id: check-yaml
- id: check-merge-conflict
- id: trailing-whitespace
- id: check-added-large-files
args: ['--maxkb=2000']
- repo: https://github.com/psf/black
rev: 22.3.0
args: ["--maxkb=2000"]

# Sort package imports alphabetically
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

# Convert relative imports to absolute imports
- repo: https://github.com/MarcoGorelli/absolufy-imports
rev: v0.3.1
hooks:
- id: absolufy-imports

# Find common spelling mistakes in comments and docstrings
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
args: ['--ignore-regex="(\b[A-Z]+\b)"', '--ignore-words-list=fom,appartment,bage,ore,setis,tabacco,berfore,vor'] # Ignore capital case words, e.g. country codes
types_or: [python, rst, markdown]
files: ^(scripts|doc)/

# Make docstrings PEP 257 compliant
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
hooks:
- id: docformatter
args: ["--in-place", "--make-summary-multi-line", "--pre-summary-newline"]

- repo: https://github.com/keewis/blackdoc
rev: v0.3.9
hooks:
- id: blackdoc

# Formatting with "black" coding style
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
# Format Python files
- id: black
# Format Jupyter Python notebooks
- id: black-jupyter

# Remove output from Jupyter notebooks
- repo: https://github.com/aflc/pre-commit-jupyter
rev: v1.2.1
hooks:
- id: jupyter-notebook-cleanup
args: ["--remove-kernel-metadata"]

# Do YAML formatting (before the linter checks it for misses)
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, "2", --preserve-quotes]

# Format Snakemake rule / workflow files
- repo: https://github.com/snakemake/snakefmt
rev: v0.6.0
rev: v0.10.2
hooks:
- id: snakefmt
- repo: https://github.com/jonasbb/pre-commit-latex-hooks
rev: v1.3.0
hooks:
- id: american-eg-ie
- id: cleveref-capitalization
- id: consistent-spelling
args:
[
"--emph=et al.",
'--regex=naive=\bna(i|\\"i)ve',
'--regex=optimisation=\boptimi(s|z)ation',
]
- id: ensure-labels-for-sections
- id: no-space-in-cite
- id: tilde-cite
- id: unique-labels
# - repo: https://github.com/fsfe/reuse-tool
# rev: latest
# hooks:
# - id: reuse

# For cleaning jupyter notebooks
- repo: https://github.com/aflc/pre-commit-jupyter
rev: v1.2.1
hooks:
- id: jupyter-notebook-cleanup
exclude: examples/solve-on-remote.ipynb
2 changes: 1 addition & 1 deletion .syncignore-send
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ __pycache__
.ipynb_checkpoints
.vscode
resources
results
results
1 change: 0 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ authors:
- family-names: Your surname
given-names: Christoph Tries
orcid: https://orcid.org/0009-0000-2425-0993

1 change: 0 additions & 1 deletion ariadne-data/costs_2025-modifications.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ offwind-ac-connection-submarine,investment,4225,EUR2020/MW/km,NEP2023,"equal to
offwind-ac-connection-underground,investment,1215,EUR2020/MW/km,NEP2023,"equal to AC overhead"
offwind-float-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"
offwind-dc-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"

1 change: 0 additions & 1 deletion ariadne-data/costs_2035-modifications.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ offwind-ac-connection-submarine,investment,4225,EUR2020/MW/km,NEP2023,"equal to
offwind-ac-connection-underground,investment,1215,EUR2020/MW/km,NEP2023,"equal to AC overhead"
offwind-float-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"
offwind-dc-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"

1 change: 0 additions & 1 deletion ariadne-data/costs_2040-modifications.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ offwind-ac-connection-submarine,investment,4225,EUR2020/MW/km,NEP2023,"equal to
offwind-ac-connection-underground,investment,1215,EUR2020/MW/km,NEP2023,"equal to AC overhead"
offwind-float-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"
offwind-dc-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"

1 change: 0 additions & 1 deletion ariadne-data/costs_2045-modifications.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ offwind-ac-connection-submarine,investment,4225,EUR2020/MW/km,NEP2023,"equal to
offwind-ac-connection-underground,investment,1215,EUR2020/MW/km,NEP2023,"equal to AC overhead"
offwind-float-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"
offwind-dc-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"

1 change: 0 additions & 1 deletion ariadne-data/costs_2050-modifications.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@ offwind-ac-connection-submarine,investment,4225,EUR2020/MW/km,NEP2023,"equal to
offwind-ac-connection-underground,investment,1215,EUR2020/MW/km,NEP2023,"equal to AC overhead"
offwind-float-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"
offwind-dc-station,investment,700,EUR2020/kW,NEP2023,"cost of two stations"

2 changes: 1 addition & 1 deletion config/config.personal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ private:

remote:
ssh: ""
path: ""
path: ""
16 changes: 8 additions & 8 deletions config/config.public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ run:
enable: true
manual_file: config/scenarios.public.yaml
file: config/scenarios.automated.yaml
shared_resources:
shared_resources:
policy: base #stops recalculating
exclude:
- existing_heating.csv # specify files which should not be shared between scenarios
- costs
- retrieve_cost # This is necessary to save retrieve_cost_data_{year}.log in the correct folder
- existing_heating.csv # specify files which should not be shared between scenarios
- costs
- retrieve_cost # This is necessary to save retrieve_cost_data_{year}.log in the correct folder

iiasa_database:
db_name: ariadne
Expand All @@ -28,8 +28,8 @@ iiasa_database:
transport_stock: DLR-VECTOR21
industry: FORECAST v1.0
scenarios:
- 8Gt_Bal_v3
- 8Gt_Elec_v3
- 8Gt_H2_v3
- 8Gt_Bal_v3
- 8Gt_Elec_v3
- 8Gt_H2_v3
reference_scenario: 8Gt_Bal_v3
region: Deutschland
region: Deutschland
72 changes: 36 additions & 36 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ run:
shared_resources:
policy: base #stops recalculating
exclude:
- existing_heating.csv # specify files which should not be shared between scenarios
- costs
- retrieve_cost # This is necessary to save retrieve_cost_data_{year}.log in the correct folder
- industry_sector_ratios
- build_industry_sector_ratios # This is necessary to save build_industry_sector_ratios_data.log in the correct folder
- existing_heating.csv # specify files which should not be shared between scenarios
- costs
- retrieve_cost # This is necessary to save retrieve_cost_data_{year}.log in the correct folder
- industry_sector_ratios
- build_industry_sector_ratios # This is necessary to save build_industry_sector_ratios_data.log in the correct folder
disable_progressbar: true
debug_co2_limit: false
debug_h2deriv_limit: false
Expand All @@ -41,14 +41,14 @@ iiasa_database:
transport: Aladin v1
industry: FORECAST v1.0
scenarios:
- CurrentPolicies
- KN2045_Elec_v4
- KN2045_H2_v4
- KN2045_Bal_v4
- KN2045plus_EasyRide
- KN2045plus_LowDemand
- KN2045minus_WorstCase
- KN2045minus_SupplyFocus
- CurrentPolicies
- KN2045_Elec_v4
- KN2045_H2_v4
- KN2045_Bal_v4
- KN2045plus_EasyRide
- KN2045plus_LowDemand
- KN2045minus_WorstCase
- KN2045minus_SupplyFocus
reference_scenario: KN2045_Bal_v4
region: Deutschland

Expand All @@ -67,7 +67,7 @@ scenario:
opts:
- ''
sector_opts:
- none
- none
planning_horizons:
- 2020
- 2025
Expand Down Expand Up @@ -102,7 +102,7 @@ atlite:
dy: 0.3
time: ['2019', '2019']


renewable:
onwind:
cutout: europe-2019-sarah3-era5
Expand Down Expand Up @@ -205,28 +205,28 @@ limits_capacity_max:
2045: 400

limits_capacity_min:
Generator:
onwind:
DE:
2030: 115 # Wind-an-Land Law
2035: 115 # Wind-an-Land Law
2040: 115 # Wind-an-Land Law
2045: 115
offwind:
DE:
2030: 30 # Wind-auf-See Law
2035: 30
2040: 30
2045: 30
solar:
DE:
Generator:
onwind:
DE:
2030: 115 # Wind-an-Land Law
2035: 115 # Wind-an-Land Law
2040: 115 # Wind-an-Land Law
2045: 115
offwind:
DE:
2030: 30 # Wind-auf-See Law
2035: 30
2040: 30
2045: 30
solar:
DE:
# EEG2023; Ziel for 2024: 88 GW and for 2026: 128 GW,
# assuming at least 1/3 of difference reached in 2025
2025: 101
2030: 101
2035: 101
2040: 101
2045: 101
2025: 101
2030: 101
2035: 101
2040: 101
2045: 101


# limits_capacity_min:
Expand Down Expand Up @@ -461,7 +461,7 @@ plotting:
#powerplants_filter: (DateOut >= 2019 or DateOut != DateOut)
electricity:
powerplants_filter: (DateOut >= 2019 or DateOut != DateOut) and not (Country == "DE" and Set == "CHP")
custom_powerplants: True
custom_powerplants: true
custom_file: resources/german_chp.csv
estimate_renewable_capacities:
year: 2019
Expand Down
8 changes: 4 additions & 4 deletions config/scenarios.manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ KN2045_H2_v4:
DE:
2020: 0
2025: 5
2030: 45 # scenario guidelines
2030: 45 # scenario guidelines
2035: 155
2040: 265
2045: 400 # scenario guidelines
Expand Down Expand Up @@ -377,9 +377,9 @@ KN2045plus_EasyRide:
steam_hydrogen_fraction: 0.3
steam_electricity_fraction: 0.3


KN2045plus_LowDemand:
# Im Vergleich zu Easy Ride eher knappe EE Erzeugung
# Im Vergleich zu Easy Ride eher knappe EE Erzeugung
# innerhalb Deutschlands und knappe Importe EE möglich
iiasa_database:
reference_scenario: KN2045plus_LowDemand # TODO: wait for database
Expand Down Expand Up @@ -622,7 +622,7 @@ KN2045minus_SupplyFocus:
2045: 30
solar:
DE:
2025: 101
2025: 101
2030: 215 # PV strategy
2035: 215 # not forcing more EE
2040: 215
Expand Down
2 changes: 1 addition & 1 deletion config/scenarios.public.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
DE:
2020: 0
2025: 5
2030: 45 # scenario guidelines
2030: 45 # scenario guidelines
2035: 155
2040: 265
2045: 400 # scenario guidelines
Expand Down
1 change: 0 additions & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,3 @@ dependencies:
- snakemake-executor-plugin-cluster-generic
- highspy
# - git+https://github.com/PyPSA/pypsa@master # Until new release

Loading

0 comments on commit 98a2acb

Please sign in to comment.