Skip to content

Commit 2a69b2e

Browse files
finozzifalkstrp
andauthored
config: add pre-commit yaml (#162)
* config: add pre-commit yaml * docs: modify release notes * config: modify environment.yaml * config: add ruff.toml * code: initial pre-commit changes * remove license * config: new licence * config: modify license * change license for Makefile * code: add license * code : add licenses * code: changes driven by linter * data: update outputs * change conf.py * change conf.py - 2 * change license * remove reuse compliance * fix docs * pin docs build requirements --------- Co-authored-by: lkstrp <[email protected]>
1 parent 0abf81f commit 2a69b2e

33 files changed

+3264
-2117
lines changed

.github/ISSUE_TEMPLATE/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: PyPSA Mailing List
4-
url: https://groups.google.com/forum/#!forum/pypsa
5-
about: Please ask and answer general usage questions here.
3+
- name: PyPSA Mailing List
4+
url: https://groups.google.com/forum/#!forum/pypsa
5+
about: Please ask and answer general usage questions here.

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
24

35
.snakemake
46
_build

.gitignore.save

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
24

35
.snakemake
46
_build

.pre-commit-config.yaml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
4+
exclude: "^LICENSES"
5+
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: check-merge-conflict
11+
- id: check-added-large-files
12+
args: ["--maxkb=2000"]
13+
14+
# Run ruff to lint and format
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
# Ruff version.
17+
rev: v0.8.6
18+
hooks:
19+
# Run the linter.
20+
- id: ruff
21+
args: [--fix]
22+
# Run the formatter.
23+
- id: ruff-format
24+
25+
# Find common spelling mistakes in comments and docstrings
26+
- repo: https://github.com/codespell-project/codespell
27+
rev: v2.3.0
28+
hooks:
29+
- id: codespell
30+
args: ['--ignore-regex="(\b[A-Z]+\b)"', '--ignore-words-list=fom,appartment,bage,ore,setis,tabacco,berfore,vor,pris,WEGE,Wege,Eletricity'] # Ignore capital case words, e.g. country codes
31+
types_or: [python, rst, markdown]
32+
files: ^(scripts|doc)/
33+
34+
# YAML formatting
35+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
36+
rev: v2.14.0
37+
hooks:
38+
- id: pretty-format-yaml
39+
exclude: pinned\.yaml$
40+
args: [--autofix, --indent, "2", --preserve-quotes]
41+
42+
# Format Snakemake rule / workflow files
43+
- repo: https://github.com/snakemake/snakefmt
44+
rev: v0.10.2
45+
hooks:
46+
- id: snakefmt

.readthedocs.yml

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
4+
15
version: 2
26

7+
sphinx:
8+
configuration: docs/conf.py
9+
310
build:
411
os: ubuntu-22.04
512
tools:

.syncignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
4+
15
.snakemake
26
.git
37
.pytest_cache

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!--
2+
SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
3+
SPDX-License-Identifier: GPL-3.0-only
4+
-->
5+
16
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/pypsa/technology-data?include_prereleases)
27
[![Documentation](https://readthedocs.org/projects/technology-data/badge/?version=latest)](https://technology-data.readthedocs.io/en/latest/?badge=latest)
38
![Licence](https://img.shields.io/github/license/pypsa/technology-data)

Snakefile

+36-26
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
4+
15

26
configfile: "config.yaml"
37

48

59
rule compile_cost_assumptions:
610
input:
7-
inflation_rate = "inputs/prc_hicp_aind__custom_9928419_spreadsheet.xlsx",
8-
pypsa_costs = "inputs/costs_PyPSA.csv",
9-
fraunhofer_costs = "inputs/Fraunhofer_ISE_costs.csv",
10-
fraunhofer_energy_prices = "inputs/Fraunhofer_ISE_energy_prices.csv",
11-
fraunhofer_vehicles_costs = "inputs/Fraunhofer_ISE_vehicles_costs.csv",
12-
EWG_costs = "inputs/EWG_costs.csv",
13-
dea_transport = "inputs/energy_transport_data_sheet_dec_2017.xlsx",
14-
dea_vehicles = "inputs/data_sheets_for_commercial_freight_and_passenger_transport_0.xlsx",
15-
dea_renewable_fuels = "inputs/data_sheets_for_renewable_fuels.xlsx",
16-
dea_storage = "inputs/technology_data_catalogue_for_energy_storage.xlsx",
17-
dea_generation = "inputs/technology_data_for_el_and_dh.xlsx",
18-
dea_heating = "inputs/technologydatafor_heating_installations_marts_2018.xlsx",
19-
dea_industrial = "inputs/technology_data_for_industrial_process_heat.xlsx",
20-
dea_ship = "inputs/data_sheets_for_maritime_commercial_freight_and_passenger_transport.xlsx",
21-
dea_ccts = "inputs/technology_data_for_carbon_capture_transport_storage.xlsx",
22-
pnnl_energy_storage = "inputs/pnnl-energy-storage-database.xlsx",
23-
manual_input = "inputs/manual_input.csv"
11+
inflation_rate="inputs/prc_hicp_aind__custom_9928419_spreadsheet.xlsx",
12+
pypsa_costs="inputs/costs_PyPSA.csv",
13+
fraunhofer_costs="inputs/Fraunhofer_ISE_costs.csv",
14+
fraunhofer_energy_prices="inputs/Fraunhofer_ISE_energy_prices.csv",
15+
fraunhofer_vehicles_costs="inputs/Fraunhofer_ISE_vehicles_costs.csv",
16+
EWG_costs="inputs/EWG_costs.csv",
17+
dea_transport="inputs/energy_transport_data_sheet_dec_2017.xlsx",
18+
dea_vehicles="inputs/data_sheets_for_commercial_freight_and_passenger_transport_0.xlsx",
19+
dea_renewable_fuels="inputs/data_sheets_for_renewable_fuels.xlsx",
20+
dea_storage="inputs/technology_data_catalogue_for_energy_storage.xlsx",
21+
dea_generation="inputs/technology_data_for_el_and_dh.xlsx",
22+
dea_heating="inputs/technologydatafor_heating_installations_marts_2018.xlsx",
23+
dea_industrial="inputs/technology_data_for_industrial_process_heat.xlsx",
24+
dea_ship="inputs/data_sheets_for_maritime_commercial_freight_and_passenger_transport.xlsx",
25+
dea_ccts="inputs/technology_data_for_carbon_capture_transport_storage.xlsx",
26+
pnnl_energy_storage="inputs/pnnl-energy-storage-database.xlsx",
27+
manual_input="inputs/manual_input.csv",
2428
output:
25-
expand("outputs/costs_{year}.csv", year = config["years"])
29+
expand("outputs/costs_{year}.csv", year=config["years"]),
2630
threads: 1
27-
resources: mem=500
28-
conda: "environment.yaml"
29-
script: "scripts/compile_cost_assumptions.py"
31+
resources:
32+
mem=500,
33+
conda:
34+
"environment.yaml"
35+
script:
36+
"scripts/compile_cost_assumptions.py"
3037

3138

3239
# rule convert_fraunhofer:
@@ -43,10 +50,13 @@ rule compile_cost_assumptions:
4350

4451
rule convert_EWG:
4552
input:
46-
EWG = "docu/EWG_LUT_100RE_All_Sectors_Global_Report_2019.pdf"
53+
EWG="docu/EWG_LUT_100RE_All_Sectors_Global_Report_2019.pdf",
4754
output:
48-
costs = "inputs/EWG_costs.csv",
55+
costs="inputs/EWG_costs.csv",
4956
threads: 1
50-
resources: mem=500
51-
conda: "environment.yaml"
52-
script: "scripts/convert_pdf_EWG_to_dataframe.py"
57+
resources:
58+
mem=500,
59+
conda:
60+
"environment.yaml"
61+
script:
62+
"scripts/convert_pdf_EWG_to_dataframe.py"

config.yaml

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
4+
15
version: 0.9.2
26

37
# considered years for output data
4-
years : [2020, 2025, 2030, 2035, 2040, 2045, 2050]
8+
years: [2020, 2025, 2030, 2035, 2040, 2045, 2050]
59

6-
expectation : "" # tech data uncertainty, possible options [None, "optimist", "pessimist"]
10+
expectation: "" # tech data uncertainty, possible options [None, "optimist", "pessimist"]
711

812
#year for EUR outputs
9-
eur_year : 2020
13+
eur_year: 2020
1014

1115
# add solar from different source
12-
solar_utility_from_vartiaien : false
13-
solar_rooftop_from_etip : false
16+
solar_utility_from_vartiaien: false
17+
solar_rooftop_from_etip: false
1418

1519
energy_storage_database:
16-
h2_from_budischak: false # add fuel cell/electrolysis efficiencies from Budischak (DEA assumptions very conservative)
17-
ewg_home_battery: true # add home battery data derived from DEA data and EWG study
18-
pnnl_energy_storage:
19-
add_data: true # add storage data mainly from PNNL
20-
approx_beyond_2030: ["same_as_2030"] # ["geometric_series"] or ["same_as_2030"]
20+
h2_from_budischak: false # add fuel cell/electrolysis efficiencies from Budischak (DEA assumptions very conservative)
21+
ewg_home_battery: true # add home battery data derived from DEA data and EWG study
22+
pnnl_energy_storage:
23+
add_data: true # add storage data mainly from PNNL
24+
approx_beyond_2030: ["same_as_2030"] # ["geometric_series"] or ["same_as_2030"]
2125

2226
# remove grid connection costs from DEA for offwind because they are calculated
2327
# separately in pypsa-eur
24-
offwind_no_gridcosts : true
28+
offwind_no_gridcosts: true
2529

2630
desalination:
27-
salinity: 35 # in PSU (Practical Salinity Unit) = kg/m^3
31+
salinity: 35 # in PSU (Practical Salinity Unit) = kg/m^3
2832

2933
ndigits: 4

docs/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
2+
#
3+
# SPDX-License-Identifier: GPL-3.0-only
4+
15
# Makefile for Sphinx documentation
26
#
37

docs/addnew.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
..
2+
SPDX-FileCopyrightText: Contributors to technology-data <https://github.com/pypsa/technology-data>
3+
4+
SPDX-License-Identifier: GPL-3.0-only
5+
16
.. _addnew:
27

38
##########################################

0 commit comments

Comments
 (0)