add rule that allows cost data to be modified
This commit is contained in:
parent
326ed63329
commit
830019a6e5
@ -743,9 +743,9 @@ rule prepare_sector_network:
|
||||
else RESOURCES
|
||||
+ "biomass_potentials_s{simpl}_{clusters}_{planning_horizons}.csv",
|
||||
heat_profile="data/heat_load_profile_BDEW.csv",
|
||||
costs="data/costs_{}.csv".format(config["costs"]["year"])
|
||||
costs="data/costs_{}-modified.csv".format(config["costs"]["year"])
|
||||
if config["foresight"] == "overnight"
|
||||
else "data/costs_{planning_horizons}.csv",
|
||||
else "data/costs_{planning_horizons}-modified.csv",
|
||||
profile_offwind_ac=RESOURCES + "profile_offwind-ac.nc",
|
||||
profile_offwind_dc=RESOURCES + "profile_offwind-dc.nc",
|
||||
h2_cavern=RESOURCES + "salt_cavern_potentials_s{simpl}_{clusters}.csv",
|
||||
|
@ -259,3 +259,17 @@ if config["enable"]["retrieve"]:
|
||||
"../envs/environment.yaml"
|
||||
script:
|
||||
"../scripts/retrieve_monthly_fuel_prices.py"
|
||||
|
||||
|
||||
rule modify_cost_data:
|
||||
input:
|
||||
costs="data/costs_{year}.csv",
|
||||
output:
|
||||
"data/costs_{year}-modified.csv"
|
||||
log:
|
||||
LOGS + "modify_cost_data_{year}.log",
|
||||
resources:
|
||||
mem_mb=1000,
|
||||
retries: 2
|
||||
script:
|
||||
"../scripts/modify_cost_data.py"
|
||||
|
12
scripts/modify_cost_data.py
Normal file
12
scripts/modify_cost_data.py
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
import pandas as pd
|
||||
|
||||
costs = pd.read_csv(snakemake.input.costs, index_col=[0, 1]).sort_index()
|
||||
|
||||
if "modifications" in snakemake.input.keys():
|
||||
modifications = pd.read_csv(snakemake.input.modifications, index_col=[0, 1]).sort_index()
|
||||
costs.loc[modifications.index] = modifications
|
||||
print(modifications)
|
||||
print( costs.loc[modifications.index])
|
||||
|
||||
costs.to_csv(snakemake.output[0])
|
Loading…
Reference in New Issue
Block a user