remove duplicate retrieve_cost_data

This commit is contained in:
Fabian Neumann 2023-03-06 15:18:30 +01:00
parent 7334913e11
commit f83fd9cf1e
2 changed files with 7 additions and 19 deletions

View File

@ -19,7 +19,7 @@ run = config.get("run", {})
RDIR = run["name"] + "/" if run.get("name") else "" RDIR = run["name"] + "/" if run.get("name") else ""
CDIR = RDIR if not run.get("shared_cutouts") else "" CDIR = RDIR if not run.get("shared_cutouts") else ""
COSTS = "resources/" + RDIR + "costs.csv" COSTS = "resources/" + RDIR + f"costs_{config['costs']['year']}.csv"
ATLITE_NPROCESSES = config["atlite"].get("nprocesses", 4) ATLITE_NPROCESSES = config["atlite"].get("nprocesses", 4)
@ -278,19 +278,18 @@ if config["enable"].get("retrieve_cost_data", True):
rule retrieve_cost_data: rule retrieve_cost_data:
input: input:
HTTP.remote( HTTP.remote(
f"raw.githubusercontent.com/PyPSA/technology-data/{config['costs']['version']}/outputs/costs_{config['costs']['year']}.csv", "raw.githubusercontent.com/PyPSA/technology-data/{}/outputs/".format(config['costs']['version']) + "costs_{year}.csv",
keep_local=True, keep_local=True,
), ),
output: output:
COSTS, "data/costs_{year}.csv",
log: log:
"logs/" + RDIR + "retrieve_cost_data.log", "logs/" + RDIR + "retrieve_cost_data_{year}.log",
resources: resources:
mem_mb=5000, mem_mb=1000,
run: run:
move(input[0], output[0]) move(input[0], output[0])
if config["enable"].get("build_natura_raster", False): if config["enable"].get("build_natura_raster", False):
rule build_natura_raster: rule build_natura_raster:
@ -642,22 +641,13 @@ datafiles = [
directory("data/jrc-idees-2015"), directory("data/jrc-idees-2015"),
] ]
if config.get('retrieve_sector_databundle', True): if config["enable"].get('retrieve_sector_databundle', True):
rule retrieve_sector_databundle: rule retrieve_sector_databundle:
output: *datafiles output: *datafiles
log: "logs/retrieve_sector_databundle.log" log: "logs/retrieve_sector_databundle.log"
script: 'scripts/retrieve_sector_databundle.py' script: 'scripts/retrieve_sector_databundle.py'
if config.get("retrieve_cost_data", True):
rule retrieve_cost_data:
input: HTTP.remote("raw.githubusercontent.com/PyPSA/technology-data/{}/outputs/".format(config['costs']['version']) + "costs_{year}.csv", keep_local=True)
output: "data/costs_{year}.csv"
log: "logs/" + RDIR + "retrieve_cost_data_{year}.log",
resources: mem_mb=1000,
run: move(input[0], output[0])
rule build_population_layouts: rule build_population_layouts:
input: input:
nuts3_shapes='resources/' + RDIR + 'nuts3_shapes.geojson', nuts3_shapes='resources/' + RDIR + 'nuts3_shapes.geojson',

View File

@ -67,6 +67,7 @@ snapshots:
enable: enable:
prepare_links_p_nom: false prepare_links_p_nom: false
retrieve_databundle: true retrieve_databundle: true
retrieve_sector_databundle: true
retrieve_cost_data: true retrieve_cost_data: true
build_cutout: false build_cutout: false
retrieve_cutout: true retrieve_cutout: true
@ -74,9 +75,6 @@ enable:
retrieve_natura_raster: true retrieve_natura_raster: true
custom_busmap: false custom_busmap: false
retrieve_sector_databundle: true
retrieve_cost_data: true
# CO2 budget as a fraction of 1990 emissions # CO2 budget as a fraction of 1990 emissions
# this is over-ridden if CO2Lx is set in sector_opts # this is over-ridden if CO2Lx is set in sector_opts
# this is also over-ridden if cb is set in sector_opts # this is also over-ridden if cb is set in sector_opts