Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BEETL data to MOABB for benchmarking #675

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
8 changes: 4 additions & 4 deletions moabb/datasets/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,24 +220,24 @@ def fs_get_file_list(article_id, version=None):
fsurl = "https://api.figshare.com/v2"
all_files = []
page = 1

while True:
if version is None:
url = f"{fsurl}/articles/{article_id}/files?page={page}&page_size=100"
headers = {"Content-Type": "application/json"}
response = fs_issue_request("GET", url, headers=headers)

if not response: # If response is empty, we've got all files
break

all_files.extend(response)
page += 1
else:
url = f"{fsurl}/articles/{article_id}/versions/{version}"
headers = {"Content-Type": "application/json"}
request = fs_issue_request("GET", url, headers=headers)
return request["files"]

return all_files


Expand Down