Skip to content

Commit a1eda75

Browse files
committed
Centralise "default_testing_repo" URL across code.
1 parent 84952cd commit a1eda75

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

neo/test/rawiotest/common_rawio_test.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@
2121
import logging
2222
import unittest
2323

24-
from neo.utils import (download_dataset,
25-
get_local_testing_data_folder, HAVE_DATALAD)
24+
from neo.utils.datasets import (download_dataset,
25+
get_local_testing_data_folder, HAVE_DATALAD, default_testing_repo)
2626

2727
from neo.test.rawiotest.tools import can_use_network
2828

2929
from neo.test.rawiotest import rawio_compliance as compliance
3030

3131

3232
# url_for_tests = "https://portal.g-node.org/neo/" #This is the old place
33-
repo_for_test = 'https://gin.g-node.org/NeuralEnsemble/ephy_testing_data'
33+
repo_for_test = default_testing_repo
34+
3435

3536
class BaseTestRawIO:
3637
'''

neo/test/utils/test_datasets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import unittest
22

3-
from neo.utils import download_dataset
3+
from neo.utils.datasets import download_dataset, default_testing_repo
44

55

66
class TestDownloadDataset(unittest.TestCase):
77
def test_download_dataset(self):
88
local_path = download_dataset(
9-
repo='https://gin.g-node.org/NeuralEnsemble/ephy_testing_data',
9+
repo=default_testing_repo,
1010
remote_path='blackrock/blackrock_2_1')
1111
assert local_path.is_dir()
1212

neo/utils/datasets.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
except:
1111
HAVE_DATALAD = False
1212

13+
default_testing_repo = 'https://gin.g-node.org/NeuralEnsemble/ephy_testing_data'
14+
1315

1416
global local_testing_data_folder
1517
if os.getenv('EPHY_TESTING_DATA_FOLDER', default=None) is not None:
@@ -24,7 +26,7 @@ def get_local_testing_data_folder():
2426
return local_testing_data_folder
2527

2628

27-
def download_dataset(repo=None, remote_path=None, local_folder=None):
29+
def download_dataset(repo=default_testing_repo, remote_path=None, local_folder=None):
2830
"""
2931
Download a dataset with datalad client.
3032
@@ -57,10 +59,6 @@ def download_dataset(repo=None, remote_path=None, local_folder=None):
5759
"""
5860
assert HAVE_DATALAD, 'You need to install datalad'
5961

60-
if repo is None:
61-
# Use gin NeuralEnsemble/ephy_testing_data
62-
repo = 'https://gin.g-node.org/NeuralEnsemble/ephy_testing_data'
63-
6462
if local_folder is None:
6563
global local_testing_data_folder
6664
local_folder = local_testing_data_folder

0 commit comments

Comments
 (0)