Skip to content

Commit dfe95c3

Browse files
committed
Merge branch 'master' into fix-fn-consistency
2 parents 4833834 + 8c35637 commit dfe95c3

31 files changed

+35105
-33366
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
# Run ruff to lint and format
1515
- repo: https://github.com/astral-sh/ruff-pre-commit
1616
# Ruff version.
17-
rev: v0.9.4
17+
rev: v0.9.9
1818
hooks:
1919
# Run the linter.
2020
- id: ruff

Snakefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#
33
# SPDX-License-Identifier: GPL-3.0-only
44

5+
import pathlib
6+
57

68
configfile: "config.yaml"
79

@@ -32,6 +34,8 @@ rule compile_cost_assumptions:
3234
mem=500,
3335
conda:
3436
"environment.yaml"
37+
log:
38+
pathlib.Path("logs", "compile_cost_assumptions.log"),
3539
script:
3640
"scripts/compile_cost_assumptions.py"
3741

@@ -40,18 +44,22 @@ rule compile_cost_assumptions_usa:
4044
input:
4145
cost_files_to_modify=expand("outputs/costs_{year}.csv", year=config["years"]),
4246
nrel_atb_input_files=expand(
43-
"inputs/atb_e_{year}.parquet",
47+
"inputs/US/atb_e_{year}.parquet",
4448
year=config["nrel_atb"]["nrel_atb_input_years"],
4549
),
46-
nrel_atb_input_discount_rate="inputs/discount_rates_usa.csv",
47-
nrel_atb_input_fuel_costs="inputs/fuel_costs_usa.csv",
50+
nrel_atb_manual_input_usa="inputs/US/manual_input_usa.csv",
51+
eur_inflation_rate="inputs/prc_hicp_aind__custom_9928419_spreadsheet.xlsx",
52+
nrel_atb_input_discount_rate="inputs/US/discount_rates_usa.csv",
53+
nrel_atb_input_fuel_costs="inputs/US/fuel_costs_usa.csv",
4854
output:
4955
expand("outputs/US/costs_{year}.csv", year=config["years"]),
5056
threads: 1
5157
resources:
5258
mem=500,
5359
conda:
5460
"environment.yaml"
61+
log:
62+
pathlib.Path("logs", "compile_cost_assumptions_usa.log"),
5563
script:
5664
"scripts/compile_cost_assumptions_usa.py"
5765

docs/release_notes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,19 @@ Upcoming Release
1616
.. The features listed below are not released yet, but will be part of the next release!
1717
.. To use the features already you have to use the ``master`` branch.
1818
19+
* Include unit test for compile_cost_assumptions_usa.py (https://github.com/PyPSA/technology-data/pull/170)
20+
21+
* US specific folder for NREL/ATB data (https://github.com/PyPSA/technology-data/pull/172)
22+
1923
* Include unit test execution and compile_cost_assumptions_usa.py in ci.yaml (https://github.com/PyPSA/technology-data/pull/174)
24+
2025
* Align `snakemake` version and the related `mock_snakemake` to PyPSA-Eur (https://github.com/PyPSA/technology-data/pull/177)
2126
* Improve filename consistency in the sources (https://github.com/PyPSA/technology-data/pull/178)
2227

28+
* Include further unit tests for compile_cost_assumptions_usa.py (https://github.com/PyPSA/technology-data/pull/182)
29+
30+
* Updates the documentation with compile_cost_assumptions_usa.py (https://github.com/PyPSA/technology-data/pull/186)
31+
2332
`v0.11.0 <https://github.com/PyPSA/technology-data/releases/tag/v0.11.0>`__ (24th January 2025)
2433
=======================================================================================
2534

docs/structure.rst

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,61 @@ Structure of the repository
1111

1212
This repository has the following structure:
1313

14-
- **inputs**: input data in format .csv or .xlsx
14+
- **inputs**: input data in format .csv, .xlsx or .parquet
1515

1616
- **outputs**: technology data saved as ``costs_{year}.csv`` format for defined years. In the output ``costs_{year}.csv`` are specified
1717

18-
* technology (e.g. 'onwind')
19-
* parameter (e.g. FOM)
20-
* value (e.g. 1.18)
21-
* unit (e.g. %/year)
22-
* source (e.g. DEA, excel_file_name.xlsx)
23-
* further description (specific assumptions, sheet name if data from a multi-sheet Excel file)
18+
* technology (e.g. 'onwind')
19+
* parameter (e.g. FOM)
20+
* value (e.g. 1.18)
21+
* unit (e.g. %/year)
22+
* source (e.g. DEA, excel_file_name.xlsx)
23+
* further description (specific assumptions, sheet name if data from a multi-sheet Excel file)
24+
* currency_year (year used for adjusting economic values to reflect current purchasing power)
25+
26+
- **outputs/US**: US-specific technology data saved as ``US/costs_{year}.csv`` format for defined years. In the outputs ``US/costs_{year}.csv`` are specified
27+
28+
* technology (e.g. 'onwind')
29+
* parameter (e.g. FOM)
30+
* value (e.g. 1.18)
31+
* unit (e.g. %/year)
32+
* source (e.g. DEA, excel_file_name.xlsx)
33+
* further description (specific assumptions, sheet name if data from a multi-sheet Excel file)
34+
* currency_year (year used for adjusting economic values to reflect current purchasing power)
35+
* financial_case (financial assumptions for the definition of the cost of capital)
36+
* scenario (technology innovation scenario)
2437

2538
- **config**:
2639

2740
.. literalinclude:: ../config.yaml
2841
:language: yaml
29-
:lines: 4-24
30-
31-
the following parameters can be set in the ``config.yaml``
32-
33-
* years : numpy array of all the years of which an output costs csv should be created
34-
* rate_inflation : inflation rate (currently: rate_inflation=0.02)
35-
* solar_utility_from_vartiaien : Bool (True/False) if solar utility data is taken from DEA or Vartiaien
36-
* solar_rooftop_from_etip : Bool (True/False) if solar rooftop data is taken from DEA or ETIP
37-
* h2_from_budischak : Bool (True/False) if fuel cell and electrolyzer efficiencies are taken from DEA or Budischak
38-
* offwind_no_gridcosts : Bool (True/False) if offshore wind grid connection costs should be removed (they are calculated seperately in PyPSA-Eur)
42+
:lines: 4-40
43+
44+
The following parameters can be set in the ``config.yaml``
45+
46+
* years : numpy array of all the years of which an output costs csv should be created
47+
* nrel_atb_input_years : list of years that define the source files
48+
* nrel_atb_columns_to_keep : list of columns to use from the NREL/ATB source files
49+
* nrel_atb_core_metric_parameter_to_keep : list of parameters to use from the NREL/ATB source files
50+
* nrel_atb_technology_to_remove : list of technologies that should be excluded from NREL/ATB
51+
* nrel_atb_source_link : source url for the NREL/ATB data used
52+
* expectation : tech data uncertainty, possible options [None, "optimist", "pessimist"]
53+
* eur_year : year for EUR outputs
54+
* solar_utility_from_vartiaien : Bool (True/False) if solar utility data is taken from DEA or Vartiaien
55+
* solar_rooftop_from_etip : Bool (True/False) if solar rooftop data is taken from DEA or ETIP
56+
* h2_from_budischak : Bool (True/False) add fuel cell/electrolysis efficiencies from Budischak
57+
* ewg_home_battery: Bool (True/False) add home battery data derived from DEA data and EWG study
58+
* add_data: Bool (True/False) add storage data mainly from PNNL
59+
* approx_beyond_2030: ["geometric_series"] or ["same_as_2030"]
60+
* offwind_no_gridcosts : Bool (True/False) if offshore wind grid connection costs should be removed (they are calculated seperately in PyPSA-Eur)
61+
* salinity : estimated in PSU (Practical Salinity Unit) = kg/m^3
62+
* ndigits : number of significant digits
3963

4064
- **scripts** :
41-
42-
* :mod:`compile_cost_assumptions.py` converts input data from multiple sources to ``cost_{year}.csv`` for chosen year. Interpolates data for missing years or calculates the costs at a certain year based on the inflation rate. Technology data from the `Danish Energy Agency <https://github.com/PyPSA/technology-data>`_ are preferred. If data are missing from all sources, these are taken from the old PyPSA cost assumptions (with a printed warning).
43-
* :mod:`convert_pdf_fraunhofer_to_dataframe.py` converts table from Fraunhofer ISE report in pdf to csv format for input data. Script can be modified to convert other .pdf sources to .csv format
44-
* :mod:`retrieve_data_from_dea.py` downloads up-to-date technology data from DEA website and saves it in the **input** folder. Optional, also retrieves the documentation of the data into the folder **docu**
65+
* :mod:`compile_cost_assumptions.py` converts input data from multiple sources to ``cost_{year}.csv`` for chosen year. Interpolates data for missing years or calculates the costs at a certain year based on the inflation rate. Technology data from the `Danish Energy Agency <https://github.com/PyPSA/technology-data>`_ are preferred. If data are missing from all sources, these are taken from the old PyPSA cost assumptions (with a printed warning).
66+
* :mod:`compile_cost_assumptions_usa.py` converts input data from NREL/ATB to ``US/cost_{year}.csv`` for chosen year. It starts from the cost assumptions files produced by `compile_cost_assumptions.py`. All technology-parameter pairs present in the NREL/ATB input data are updated. Those not present in NREL/ATB are left untouched.
67+
* :mod:`convert_pdf_fraunhofer_to_dataframe.py` converts table from Fraunhofer ISE report in pdf to csv format for input data. Script can be modified to convert other .pdf sources to .csv format
68+
* :mod:`retrieve_data_from_dea.py` downloads up-to-date technology data from DEA website and saves it in the **input** folder. Optional, also retrieves the documentation of the data into the folder **docu**
4569

4670
- **docu**: reports, paper, additional information about the input data, format .pdf
4771

0 commit comments

Comments
 (0)