retrieve*: clean retrieve rules
This commit is contained in:
parent
3597f931cf
commit
0c537f159f
@ -1,10 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
## Copyright 2019 Fabian Hofmann (FIAS)
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Created on Mon Nov 4 18:37:11 2019
|
|
||||||
|
|
||||||
@author: fabian
|
|
||||||
"""
|
|
||||||
|
|
||||||
import logging, os, tarfile
|
import logging, os, tarfile
|
||||||
from _helpers import progress_retrieve
|
from _helpers import progress_retrieve
|
||||||
@ -16,11 +10,10 @@ if snakemake.config['tutorial']:
|
|||||||
else:
|
else:
|
||||||
url = "https://zenodo.org/record/3517949/files/pypsa-eur-cutouts.tar.xz"
|
url = "https://zenodo.org/record/3517949/files/pypsa-eur-cutouts.tar.xz"
|
||||||
|
|
||||||
file = "./cutouts.tar.xz"
|
tarball_fn = "./cutouts.tar.xz"
|
||||||
|
|
||||||
progress_retrieve(url, file)
|
progress_retrieve(url, tarball_fn)
|
||||||
|
|
||||||
# extract
|
tarfile.open(tarball_fn).extractall()
|
||||||
tarfile.open('./cutouts.tar.xz').extractall()
|
|
||||||
os.remove("./cutouts.tar.xz")
|
|
||||||
|
|
||||||
|
os.remove(tarball_fn)
|
||||||
|
@ -1,28 +1,19 @@
|
|||||||
#!/usr/bin/env python3
|
## Copyright 2019 Fabian Hofmann (FIAS)
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Created on Mon Nov 4 18:37:11 2019
|
|
||||||
|
|
||||||
@author: fabian
|
|
||||||
"""
|
|
||||||
|
|
||||||
import logging, os, tarfile
|
import logging, os, tarfile
|
||||||
from _helpers import progress_retrieve
|
from _helpers import progress_retrieve
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
if snakemake.config['tutorial']:
|
if snakemake.config['tutorial']:
|
||||||
url = "https://zenodo.org/record/3517921/files/pypsa-eur-tutorial-data-bundle.tar.xz"
|
url = "https://zenodo.org/record/3517921/files/pypsa-eur-tutorial-data-bundle.tar.xz"
|
||||||
else:
|
else:
|
||||||
url = "https://zenodo.org/record/3517935/files/pypsa-eur-data-bundle.tar.xz"
|
url = "https://zenodo.org/record/3517935/files/pypsa-eur-data-bundle.tar.xz"
|
||||||
|
|
||||||
file = "./bundle.tar.xz"
|
tarball_fn = "./bundle.tar.xz"
|
||||||
|
|
||||||
progress_retrieve(url, file)
|
progress_retrieve(url, tarball_fn)
|
||||||
|
|
||||||
# extract
|
tarfile.open(tarball_fn).extractall('./data')
|
||||||
tarfile.open('./bundle.tar.xz').extractall('./data')
|
|
||||||
|
|
||||||
os.remove("./bundle.tar.xz")
|
|
||||||
|
|
||||||
|
os.remove(tarball_fn)
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
## Copyright 2019 Fabian Hofmann (FIAS)
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Created on Mon Nov 4 18:37:11 2019
|
|
||||||
|
|
||||||
@author: fabian
|
|
||||||
"""
|
|
||||||
|
|
||||||
import logging, os
|
import logging, os
|
||||||
from _helpers import progress_retrieve
|
from _helpers import progress_retrieve
|
||||||
@ -15,7 +9,6 @@ d = './resources'
|
|||||||
if not os.path.exists(d):
|
if not os.path.exists(d):
|
||||||
os.makedirs(d)
|
os.makedirs(d)
|
||||||
|
|
||||||
url = "https://zenodo.org/record/3518215/files/natura.tiff"
|
progress_retrieve("https://zenodo.org/record/3518215/files/natura.tiff",
|
||||||
file = "resources/natura.tiff"
|
"resources/natura.tiff")
|
||||||
progress_retrieve(url, file)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user