Skip to content

Commit 1d3eb62

Browse files
authored
Merge pull request #130 from PyPSA/optimist_pessimist
bugfixing for optimist and pessimist cost data and fixing environment yaml
2 parents dd8d72f + 0edd2e0 commit 1d3eb62

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
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

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ 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 running the package
9+
- snakemake-minimal>=8.5
10+
- pandas>=2.1
1011
- numpy
1112
- beautifulsoup4
1213
- xlrd
1314
- scipy
14-
- openpyxl<=3.1.0
15+
- openpyxl>=3.1.2
1516
- packaging
1617

1718
- pip:

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)