mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-05 01:32:40 +02:00
merging with the gpy devel branch to be in sync with the latest code and make pull request again ..
This commit is contained in:
commit
f0f1a183b0
12 changed files with 204 additions and 40 deletions
|
|
@ -206,7 +206,10 @@ def authorize_download(dataset_name=None):
|
|||
|
||||
def download_data(dataset_name=None):
|
||||
"""Check with the user that the are happy with terms and conditions for the data set, then download it."""
|
||||
import itertools
|
||||
try:
|
||||
from itertools import zip_longest
|
||||
except ImportError:
|
||||
from itertools import izip_longest as zip_longest
|
||||
|
||||
dr = data_resources[dataset_name]
|
||||
if not authorize_download(dataset_name):
|
||||
|
|
@ -220,8 +223,8 @@ def download_data(dataset_name=None):
|
|||
if 'suffices' in dr: zip_urls += (dr['suffices'], )
|
||||
else: zip_urls += ([],)
|
||||
|
||||
for url, files, save_names, suffices in itertools.zip_longest(*zip_urls, fillvalue=[]):
|
||||
for f, save_name, suffix in itertools.zip_longest(files, save_names, suffices, fillvalue=None):
|
||||
for url, files, save_names, suffices in zip_longest(*zip_urls, fillvalue=[]):
|
||||
for f, save_name, suffix in zip_longest(files, save_names, suffices, fillvalue=None):
|
||||
download_url(os.path.join(url,f), dataset_name, save_name, suffix=suffix)
|
||||
|
||||
return True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue