Skip to content

Commit dc8d15c

Browse files
authored
Merge pull request #100 from FZJ-INM1-BDA/chore_bugfixes
bugfixes - misc
2 parents 934f367 + c54cee1 commit dc8d15c

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

.github/workflows/siibra-testing.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: [ '3.8', '3.7' ]
15+
python-version: [ '3.8', '3.7', '3.6' ]
1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Set up Python ${{ matrix.python-version }}

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
numpy>=1.20
1+
numpy
22
requests
33
nibabel
44
anytree

siibra/core/concept.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ def _populate_datasets(self):
137137
type_id = Dataset.extract_type_id(spec)
138138
Specialist = Dataset.REGISTRY.get(type_id, None)
139139
if Specialist is None:
140-
raise RuntimeError(
141-
f"No class available for building datasets with type {spec.get('@type',None)}. Candidates were {','.join(Dataset.REGISTRY.keys())}. Specification was: {spec}."
142-
)
140+
logger.warn(f"No class available for building datasets with type {spec.get('@type',None)}. Candidates were {','.join(Dataset.REGISTRY.keys())}. Specification was: {spec}.")
143141
else:
144142
obj = Specialist._from_json(spec)
145143
logger.debug(

siibra/core/region.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"Both",
4545
]
4646

47+
REGEX_TYPE=type(re.compile('test'))
4748

4849
class Region(anytree.NodeMixin, AtlasConcept):
4950
"""
@@ -274,9 +275,6 @@ def splitstr(s):
274275
return self.index.label == regionspec
275276
elif isinstance(regionspec, ParcellationIndex):
276277
return self.index == regionspec
277-
elif isinstance(regionspec, re.Pattern):
278-
# match regular expression
279-
return any(regionspec.search(s) is not None for s in [self.name, self.key])
280278
elif isinstance(regionspec, str):
281279
# string is given, perform some lazy string matching
282280
q = regionspec.lower().strip()
@@ -292,6 +290,10 @@ def splitstr(s):
292290
for w in splitstr(__class__._clear_name(regionspec))
293291
]
294292
)
293+
# Python 3.6 does not support re.Pattern
294+
elif isinstance(regionspec, REGEX_TYPE):
295+
# match regular expression
296+
return any(regionspec.search(s) is not None for s in [self.name, self.key])
295297
else:
296298
raise TypeError(
297299
f"Cannot interpret region specification of type '{type(regionspec)}'"

siibra/features/ieeg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def __init__(self,**kwargs):
215215
logger.debug(f"Retrieving from {fname}")
216216

217217
obj = parse_ptsfile(loader.data.decode())
218-
subject_id = fname.split("_")[0]
218+
subject_id = fname.replace('ieeg_contact_points/', '').split("_")[0]
219219
session = dset.new_session(subject_id)
220220
for electrode_id, contact_points in obj.items():
221221
electrode = session.new_electrode(electrode_id)

siibra/features/receptors.py

+2
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ def __init__(self, region, kg_result):
367367
self.modality = kg_result["modality"]
368368

369369
urls = kg_result["files"]
370+
371+
self.files=urls
370372

371373
def urls_matching(regex):
372374
return filter(lambda u: re.match(regex, u), urls)

0 commit comments

Comments
 (0)