Skip to content

Commit b56ca41

Browse files
kroq-gar78mvdoc
authored andcommitted
dataset: add fallback overload for get_surf's dynamic hemi/merge callers
Ported from 9abb080 (types-data branch) / bb81c50a (types-easy); the rest of that change (retyping Database.auxfile, fixing get_cache's hashlib bug) is owned by PR 4 (5b3496d on types-01-03-04-infra-geometry-database), not here.
1 parent 45e3f51 commit b56ca41

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cortex/dataset/dataset.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ def get_surf(self, subject: str, type: str, hemi: Literal['both']='both', *, mer
166166
@overload
167167
def get_surf(self, subject: str, type: str, hemi: Literal['lh', 'rh'], merge: bool=False, nudge: bool=False) -> tuple[npt.NDArray[np.floating], npt.NDArray[np.integer]]: ...
168168

169+
# Fallthrough case for callers (e.g. Database.get_surf) forwarding a dynamic
170+
# hemi/merge that isn't statically one of the above.
171+
@overload
172+
def get_surf(self, subject: str, type: str, hemi: Literal['both', 'lh', 'rh']='both', merge: bool=False, nudge: bool=False) -> Union[tuple[tuple[npt.NDArray[np.floating], npt.NDArray[np.integer]], tuple[npt.NDArray[np.floating], npt.NDArray[np.integer]]], tuple[npt.NDArray[np.floating], npt.NDArray[np.integer]]]: ...
173+
169174
def get_surf(self, subject: str, type: str, hemi: Literal['both', 'lh', 'rh']='both', merge: bool=False, nudge: bool=False) -> Union[tuple[tuple[npt.NDArray[np.floating], npt.NDArray[np.integer]], tuple[npt.NDArray[np.floating], npt.NDArray[np.integer]]], tuple[npt.NDArray[np.floating], npt.NDArray[np.integer]]]:
170175
pts: npt.NDArray[np.floating]
171176
polys: npt.NDArray[np.integer]

0 commit comments

Comments
 (0)