Skip to content

Commit 34a051f

Browse files
committed
import datatlad only when running download_dataset()
1 parent 10c2884 commit 34a051f

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

neo/utils/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@
55
from .misc import (get_events, get_epochs, add_epoch,
66
match_events, cut_block_by_epochs, cut_segment_by_epoch,
77
is_block_rawio_compatible)
8-
from .datasets import (download_dataset,
9-
get_local_testing_data_folder, HAVE_DATALAD)
8+
from .datasets import download_dataset, get_local_testing_data_folder

neo/utils/datasets.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44
import os
55
from pathlib import Path
66

7-
try:
8-
import datalad.api
9-
from datalad.support.gitrepo import GitRepo
10-
11-
HAVE_DATALAD = True
12-
except:
13-
HAVE_DATALAD = False
14-
157
default_testing_repo = 'https://gin.g-node.org/NeuralEnsemble/ephy_testing_data'
168

179
global local_testing_data_folder
@@ -59,7 +51,8 @@ def download_dataset(repo=default_testing_repo, remote_path=None,
5951
local_path:
6052
The local path of the downloaded file or folder
6153
"""
62-
assert HAVE_DATALAD, 'You need to install datalad'
54+
import datalad.api
55+
from datalad.support.gitrepo import GitRepo
6356

6457
if local_folder is None:
6558
global local_testing_data_folder

0 commit comments

Comments
 (0)