Skip to content

Commit

Permalink
BF: make compatible with pybids 0.6.4
Browse files Browse the repository at this point in the history
in 0.6 pybids

- dropped installation schemes
- broke API

may be https://github.com/INCF/pybids/pull/218/files would return installation
scheme to improve compatibility, but I guess we should no longer rely on
it anyways
  • Loading branch information
yarikoptic committed Jul 28, 2018
1 parent a2120de commit c267861
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
14 changes: 6 additions & 8 deletions datalad_neuroimaging/extractors/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ def get_metadata(self, dataset, content):
if not exists(opj(self.ds.path, self._dsdescr_fname)):
return {}, []

bids = BIDSLayout(
self.ds.path,
config=[
'bids', (
'derivatives',
'derivatives' if exists(opj(self.ds.path, 'derivatives')) else curdir
)],
)
paths = [(self.ds.path, 'bids')]
derivs_path = opj(self.ds.path, 'derivatives')
if exists(opj(self.ds.path, 'derivatives')):
paths.append((derivs_dir, ['bids', 'derivatives']))

bids = BIDSLayout(paths)
dsmeta = self._get_dsmeta(bids)

if not content:
Expand Down
10 changes: 7 additions & 3 deletions datalad_neuroimaging/extractors/tests/test_bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def test_get_metadata(path):
@with_tree(tree={'dataset_description.json': """
{
"Name": "test",
"BIDSVersion": "1.0.0-rc3",
"Description": "Some description"
}
""",
Expand All @@ -113,7 +114,8 @@ def test_get_metadata_with_description_and_README(path):
dump,
"""\
{
"conformsto": "http://bids.neuroimaging.io",
"BIDSVersion": "1.0.0-rc3",
"conformsto": "http://bids.neuroimaging.io/bids_spec1.0.0-rc3.pdf",
"description": "Some description",
"name": "test"
}""")
Expand All @@ -123,7 +125,8 @@ def test_get_metadata_with_description_and_README(path):
# https://github.com/datalad/datalad/issues/1138
@with_tree(tree={'dataset_description.json': """
{
"Name": "test"
"Name": "test",
"BIDSVersion": "1.0.0-rc3"
}
""",
'README': u"""
Expand All @@ -139,7 +142,8 @@ def test_get_metadata_with_README(path):
dump,
u"""\
{
"conformsto": "http://bids.neuroimaging.io",
"BIDSVersion": "1.0.0-rc3",
"conformsto": "http://bids.neuroimaging.io/bids_spec1.0.0-rc3.pdf",
"description": "A very detailed\\ndescription с юникодом",
"name": "test"
}""")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def findsome(subdir, extensions):
'datalad[full]>=0.10.0.rc1',
#'datalad-webapp',
'pydicom', # DICOM metadata
'pybids[analysis]>=0.5.1', # BIDS metadata
'pybids>=0.6.4', # BIDS metadata
'nibabel', # NIfTI metadata
'pandas', # bids2scidata export
],
Expand Down

0 comments on commit c267861

Please sign in to comment.