|
1 | 1 | """BIDSLayout class.""" |
2 | 2 | import os |
3 | | -import json |
4 | 3 | import re |
5 | 4 | from collections import defaultdict |
6 | 5 | from io import open |
7 | 6 | from functools import partial, lru_cache |
8 | 7 | from itertools import chain |
9 | 8 | import copy |
10 | | -import warnings |
11 | 9 | import enum |
12 | 10 | import difflib |
13 | 11 | from pathlib import Path |
|
19 | 17 | from ..utils import listify, natural_sort |
20 | 18 | from ..external import inflect |
21 | 19 | from ..exceptions import ( |
22 | | - BIDSDerivativesValidationError, |
23 | 20 | BIDSEntityError, |
24 | 21 | BIDSValidationError, |
25 | 22 | NoMatchError, |
|
30 | 27 | absolute_path_deprecation_warning, |
31 | 28 | indexer_arg_deprecation_warning) |
32 | 29 | from .writing import build_path, write_to_file |
33 | | -from .models import (Base, Config, BIDSFile, Entity, Tag) |
| 30 | +from .models import (Config, BIDSFile, Entity, Tag) |
34 | 31 | from .index import BIDSLayoutIndexer |
35 | 32 | from .db import ConnectionManager |
36 | 33 | from .utils import (BIDSMetadata, parse_file_entities) |
37 | 34 |
|
38 | | -try: |
39 | | - from os.path import commonpath |
40 | | -except ImportError: |
41 | | - def commonpath(paths): |
42 | | - prefix = os.path.commonprefix(paths) |
43 | | - if not os.path.isdir(prefix): |
44 | | - prefix = os.path.dirname(prefix) |
45 | | - return prefix |
46 | | - |
47 | 35 | __all__ = ['BIDSLayout'] |
48 | 36 |
|
49 | 37 |
|
@@ -276,7 +264,7 @@ def _sanitize_query_dtypes(self, entities): |
276 | 264 | entities[name] = [ents[name]._astype(v) for v in val] |
277 | 265 | else: |
278 | 266 | entities[name] = ents[name]._astype(val) |
279 | | - except: |
| 267 | + except Exception: |
280 | 268 | pass |
281 | 269 | return entities |
282 | 270 |
|
|
0 commit comments