Skip to content

Commit

Permalink
bugfixing for optimist and pessimist cost data and fixing environment…
Browse files Browse the repository at this point in the history
….yaml for mock_snakemake
  • Loading branch information
toniseibold committed May 7, 2024
1 parent b44f5ae commit 53913fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 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: 6 additions & 3 deletions environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ channels:
- conda-forge
- bioconda
dependencies:
- python>=3.9,<3.11
- python>=3.8
- pip
- snakemake-minimal
- pandas>=1.1.0
# for debugging
- pypsa>=0.26.1
# for running the package
- snakemake-minimal>=8.5
- pandas>=2.1
- numpy
- beautifulsoup4
- xlrd
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 53913fc

Please sign in to comment.