Move logic to retrieve.smk
This commit is contained in:
parent
30a81a559f
commit
730b320596
@ -48,10 +48,7 @@ wildcard_constraints:
|
|||||||
|
|
||||||
include: "rules/common.smk"
|
include: "rules/common.smk"
|
||||||
include: "rules/collect.smk"
|
include: "rules/collect.smk"
|
||||||
if (config["enable"].get("retrieve","auto") == "auto" and has_internet_access())or config["enable"]["retrieve"] is True:
|
|
||||||
include: "rules/retrieve.smk"
|
include: "rules/retrieve.smk"
|
||||||
else:
|
|
||||||
print("Datafile downloads disabled in config[retrieve] or no internet access.")
|
|
||||||
include: "rules/build_electricity.smk"
|
include: "rules/build_electricity.smk"
|
||||||
include: "rules/build_sector.smk"
|
include: "rules/build_sector.smk"
|
||||||
include: "rules/solve_electricity.smk"
|
include: "rules/solve_electricity.smk"
|
||||||
|
@ -2,7 +2,14 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
if config["enable"].get("retrieve_databundle", True):
|
if config["enable"].get("retrieve", "auto") == "auto":
|
||||||
|
config["enable"]["retrieve"] = has_internet_access()
|
||||||
|
|
||||||
|
if config["enable"]["retrieve"] is False:
|
||||||
|
print("Datafile downloads disabled in config[retrieve] or no internet access.")
|
||||||
|
|
||||||
|
|
||||||
|
if config["enable"]["retrieve"] and config["enable"].get("retrieve_databundle", True):
|
||||||
datafiles = [
|
datafiles = [
|
||||||
"ch_cantons.csv",
|
"ch_cantons.csv",
|
||||||
"je-e-21.03.02.xls",
|
"je-e-21.03.02.xls",
|
||||||
@ -32,7 +39,7 @@ if config["enable"].get("retrieve_databundle", True):
|
|||||||
"../scripts/retrieve_databundle.py"
|
"../scripts/retrieve_databundle.py"
|
||||||
|
|
||||||
|
|
||||||
if config["enable"].get("retrieve_cutout", True):
|
if config["enable"]["retrieve"] and config["enable"].get("retrieve_cutout", True):
|
||||||
|
|
||||||
rule retrieve_cutout:
|
rule retrieve_cutout:
|
||||||
input:
|
input:
|
||||||
@ -51,7 +58,7 @@ if config["enable"].get("retrieve_cutout", True):
|
|||||||
move(input[0], output[0])
|
move(input[0], output[0])
|
||||||
|
|
||||||
|
|
||||||
if config["enable"].get("retrieve_cost_data", True):
|
if config["enable"]["retrieve"] and config["enable"].get("retrieve_cost_data", True):
|
||||||
|
|
||||||
rule retrieve_cost_data:
|
rule retrieve_cost_data:
|
||||||
input:
|
input:
|
||||||
@ -73,7 +80,9 @@ if config["enable"].get("retrieve_cost_data", True):
|
|||||||
move(input[0], output[0])
|
move(input[0], output[0])
|
||||||
|
|
||||||
|
|
||||||
if config["enable"].get("retrieve_natura_raster", True):
|
if config["enable"]["retrieve"] and config["enable"].get(
|
||||||
|
"retrieve_natura_raster", True
|
||||||
|
):
|
||||||
|
|
||||||
rule retrieve_natura_raster:
|
rule retrieve_natura_raster:
|
||||||
input:
|
input:
|
||||||
@ -93,7 +102,9 @@ if config["enable"].get("retrieve_natura_raster", True):
|
|||||||
move(input[0], output[0])
|
move(input[0], output[0])
|
||||||
|
|
||||||
|
|
||||||
if config["enable"].get("retrieve_sector_databundle", True):
|
if config["enable"]["retrieve"] and config["enable"].get(
|
||||||
|
"retrieve_sector_databundle", True
|
||||||
|
):
|
||||||
datafiles = [
|
datafiles = [
|
||||||
"data/eea/UNFCCC_v23.csv",
|
"data/eea/UNFCCC_v23.csv",
|
||||||
"data/switzerland-sfoe/switzerland-new_format.csv",
|
"data/switzerland-sfoe/switzerland-new_format.csv",
|
||||||
@ -120,7 +131,9 @@ if config["enable"].get("retrieve_sector_databundle", True):
|
|||||||
"../scripts/retrieve_sector_databundle.py"
|
"../scripts/retrieve_sector_databundle.py"
|
||||||
|
|
||||||
|
|
||||||
if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
|
if config["enable"]["retrieve"] and (
|
||||||
|
config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]
|
||||||
|
):
|
||||||
datafiles = [
|
datafiles = [
|
||||||
"IGGIELGN_LNGs.geojson",
|
"IGGIELGN_LNGs.geojson",
|
||||||
"IGGIELGN_BorderPoints.geojson",
|
"IGGIELGN_BorderPoints.geojson",
|
||||||
@ -140,6 +153,8 @@ if config["sector"]["gas_network"] or config["sector"]["H2_retrofit"]:
|
|||||||
"../scripts/retrieve_gas_infrastructure_data.py"
|
"../scripts/retrieve_gas_infrastructure_data.py"
|
||||||
|
|
||||||
|
|
||||||
|
if config["enable"]["retrieve"]:
|
||||||
|
|
||||||
rule retrieve_electricity_demand:
|
rule retrieve_electricity_demand:
|
||||||
input:
|
input:
|
||||||
HTTP.remote(
|
HTTP.remote(
|
||||||
@ -158,6 +173,8 @@ rule retrieve_electricity_demand:
|
|||||||
move(input[0], output[0])
|
move(input[0], output[0])
|
||||||
|
|
||||||
|
|
||||||
|
if config["enable"]["retrieve"]:
|
||||||
|
|
||||||
rule retrieve_ship_raster:
|
rule retrieve_ship_raster:
|
||||||
input:
|
input:
|
||||||
HTTP.remote(
|
HTTP.remote(
|
||||||
|
Loading…
Reference in New Issue
Block a user