|
1 | 1 | import logging |
2 | 2 | from functools import partial |
3 | 3 | from pathlib import Path |
4 | | -from typing import List, Optional |
| 4 | +from typing import List, Literal, Optional, overload |
5 | 5 |
|
6 | 6 | from elbow.builders import build_parquet, build_table |
7 | 7 | from elbow.sources.filesystem import Crawler |
|
13 | 13 | logger = logging.getLogger("bids2table") |
14 | 14 |
|
15 | 15 |
|
| 16 | +@overload |
| 17 | +def bids2table( |
| 18 | + root: StrOrPath, |
| 19 | + *, |
| 20 | + with_meta: bool = True, |
| 21 | + persistent: bool = False, |
| 22 | + index_path: Optional[StrOrPath] = None, |
| 23 | + exclude: Optional[List[str]] = None, |
| 24 | + incremental: bool = False, |
| 25 | + overwrite: bool = False, |
| 26 | + workers: Optional[int] = None, |
| 27 | + worker_id: Optional[int] = None, |
| 28 | + return_table: Literal[True] = True, |
| 29 | +) -> BIDSTable: ... |
| 30 | +@overload |
| 31 | +def bids2table( |
| 32 | + root: StrOrPath, |
| 33 | + *, |
| 34 | + with_meta: bool = True, |
| 35 | + persistent: bool = False, |
| 36 | + index_path: Optional[StrOrPath] = None, |
| 37 | + exclude: Optional[List[str]] = None, |
| 38 | + incremental: bool = False, |
| 39 | + overwrite: bool = False, |
| 40 | + workers: Optional[int] = None, |
| 41 | + worker_id: Optional[int] = None, |
| 42 | + return_table: Literal[False], |
| 43 | +) -> None: ... |
16 | 44 | def bids2table( |
17 | 45 | root: StrOrPath, |
18 | 46 | *, |
|
0 commit comments