-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSnakefile
55 lines (41 loc) · 1.68 KB
/
Snakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SPDX-FileCopyrightText: : 2022 The PyPSA-Africa Authors
#
# SPDX-License-Identifier: GPL-3.0-or-later
from os.path import normpath, exists, isdir
from shutil import copyfile
from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider
HTTP = HTTPRemoteProvider()
if not exists("config.yaml"):
copyfile("config.default.yaml", "config.yaml")
if not exists("out"):
os.mkdir(os.path.join(os.getcwd(), "out"))
if not exists("cache"):
os.mkdir(os.path.join(os.getcwd(), "cache"))
configfile: "config.yaml"
wildcard_constraints:
simpl="[a-zA-Z0-9]*|all",
clusters="[0-9]+m?|all",
ll="(v|c)([0-9\.]+|opt|all)|all",
opts="[-+a-zA-Z0-9\.]*",
rule download_data:
output:
cccodes="data/raw/country-and-continent-codes-list-csv_csv.zip",
borders="data/raw/TM_WORLD_BORDERS-0.3.zip",
wbpop="data/raw/wb_pop.zip",
wbgdp_per_capita="data/raw/GDPpc-wb-1960-2018.zip",
wbgdp="data/raw/GDP-wb-1960-2019.zip",
ungdp="data/raw/UN_GDP_region_2015dollars.zip",
ungdp_somalia="data/raw/UNdata_Export_20201006_214431107_SomaliaGDPpc.zip",
wbrain="data/raw/rainfall_1960-2016.zip",
wbtemperature="data/raw/temperature_1960-2016.zip",
battle_deaths="data/raw/API_VC.BTL.DETH_DS2_en_csv_v2_2167203.zip",
iea_cdd="data/raw/CDD_18_IEA_20210406.zip",
iea_hdd="data/raw/HDD_18_IEA_20210406.zip",
atalla_cdd_hdd="data/raw/CDD_HDD_18_Atalla_20210406.zip"
log: "logs/download.log"
script: "demand/data/download_data.py"
rule run_arima:
input:
cccodes="data/raw/country-and-continent-codes-list-csv_csv.zip"
log: "logs/download.log"
script: "demand/models/run_arima.py"