Skip to content

Commit 53913fc

Browse files
committed
bugfixing for optimist and pessimist cost data and fixing environment.yaml for mock_snakemake
1 parent b44f5ae commit 53913fc

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

Snakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ rule compile_cost_assumptions:
88
pypsa_costs = "inputs/costs_PyPSA.csv",
99
fraunhofer_costs = "inputs/Fraunhofer_ISE_costs.csv",
1010
fraunhofer_energy_prices = "inputs/Fraunhofer_ISE_energy_prices.csv",
11-
fraunhofer_vehicles_costs = "inputs/Fraunhofer_ISE_vehicles_costs.csv",
11+
fraunhofer_vehicles_costs = "inputs/Fraunhofer_ISE_vehicles_costs.csv",
1212
EWG_costs = "inputs/EWG_costs.csv",
1313
dea_transport = "inputs/energy_transport_data_sheet_dec_2017.xlsx",
1414
dea_renewable_fuels = "inputs/data_sheets_for_renewable_fuels.xlsx",

environment.yaml

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ channels:
33
- conda-forge
44
- bioconda
55
dependencies:
6-
- python>=3.9,<3.11
6+
- python>=3.8
77
- pip
8-
- snakemake-minimal
9-
- pandas>=1.1.0
8+
# for debugging
9+
- pypsa>=0.26.1
10+
# for running the package
11+
- snakemake-minimal>=8.5
12+
- pandas>=2.1
1013
- numpy
1114
- beautifulsoup4
1215
- xlrd

scripts/compile_cost_assumptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ def get_data_DEA(tech, data_in, expectation=None):
344344
excel.loc[swap, "2050-optimist"] = tmp
345345

346346
if expectation:
347+
# drop duplicates
348+
excel = excel[~excel.index.duplicated()]
347349
excel.loc[:,2050] = excel.loc[:,f"2050-{expectation}"].combine_first(excel.loc[:,2050])
348350
excel.drop(columns=uncertainty_columns, inplace=True)
349351

@@ -1039,6 +1041,8 @@ def order_data(tech_data):
10391041
clean_df[tech] = pd.concat([clean_df[tech], fixed])
10401042
fom = pd.DataFrame(columns=fixed.columns)
10411043
if not any(fixed.unit.str.contains('% of specific investment/year')):
1044+
investment[investment==0] = float('nan')
1045+
investment = investment.ffill(axis=1).fillna(0)
10421046
fom[years] = fixed[years]/investment[years].values*100
10431047
else:
10441048
fom[years] = fixed[years]

0 commit comments

Comments
 (0)