File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 99import os .path as op
1010
1111import numpy as np
12- from bids import BIDSLayout
1312from loguru import logger
1413
1514from physutils import physio
@@ -28,7 +27,7 @@ def load_from_bids(
2827 suffix = "physio" ,
2928):
3029 """
31- Load physiological data from BIDS-formatted directory
30+ Load physiological data from BIDS-formatted directory.
3231
3332 Parameters
3433 ----------
@@ -50,6 +49,12 @@ def load_from_bids(
5049 data : :class:`physutils.Physio`
5150 Loaded physiological data
5251 """
52+ try :
53+ from bids import BIDSLayout
54+ except ImportError :
55+ raise ImportError (
56+ "To use BIDS-based feature, pybids must be installed. Install manually or with `pip install physutils[bids]`"
57+ )
5358
5459 # check if file exists and is in BIDS format
5560 if not op .exists (bids_path ):
Original file line number Diff line number Diff line change 1111
1212# from loguru import logger
1313
14-
1514try :
1615 from pydra import task
1716except ImportError :
Original file line number Diff line number Diff line change @@ -24,8 +24,6 @@ install_requires =
2424 matplotlib
2525 numpy >=1.9.3
2626 loguru
27- pydra
28- pybids
2927tests_require =
3028 pytest >=3.6
3129test_suite = pytest
@@ -34,6 +32,10 @@ packages = find:
3432include_package_data = True
3533
3634[options.extras_require]
35+ pydra =
36+ pydra
37+ bids =
38+ pybids
3739doc =
3840 sphinx >=2.0
3941 sphinx-argparse
4951 scipy
5052 pytest >=5.3
5153 pytest-cov
54+ %(pydra)s
55+ %(bids)s
5256 %(style)s
5357devtools =
5458 pre-commit
You can’t perform that action at this time.
0 commit comments