Skip to content

Commit

Permalink
Merge pull request #130 from PyPSA/optimist_pessimist
Browse files Browse the repository at this point in the history
bugfixing for optimist and pessimist cost data and fixing environment yaml
  • Loading branch information
fneum committed May 12, 2024
2 parents dd8d72f + 0edd2e0 commit 1d3eb62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ rule compile_cost_assumptions:
pypsa_costs = "inputs/costs_PyPSA.csv",
fraunhofer_costs = "inputs/Fraunhofer_ISE_costs.csv",
fraunhofer_energy_prices = "inputs/Fraunhofer_ISE_energy_prices.csv",
fraunhofer_vehicles_costs = "inputs/Fraunhofer_ISE_vehicles_costs.csv",
fraunhofer_vehicles_costs = "inputs/Fraunhofer_ISE_vehicles_costs.csv",
EWG_costs = "inputs/EWG_costs.csv",
dea_transport = "inputs/energy_transport_data_sheet_dec_2017.xlsx",
dea_renewable_fuels = "inputs/data_sheets_for_renewable_fuels.xlsx",
Expand Down
9 changes: 5 additions & 4 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ channels:
- conda-forge
- bioconda
dependencies:
- python>=3.9,<3.11
- python>=3.8
- pip
- snakemake-minimal
- pandas>=1.1.0
# for running the package
- snakemake-minimal>=8.5
- pandas>=2.1
- numpy
- beautifulsoup4
- xlrd
- scipy
- openpyxl<=3.1.0
- openpyxl>=3.1.2
- packaging

- pip:
Expand Down
4 changes: 4 additions & 0 deletions scripts/compile_cost_assumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ def get_data_DEA(tech, data_in, expectation=None):
excel.loc[swap, "2050-optimist"] = tmp

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

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

0 comments on commit 1d3eb62

Please sign in to comment.