ENH add types for Database and transforms - #667
Draft
kroq-gar78 wants to merge 39 commits into
Draft
Conversation
Extracted from 6a91478; the dataset/view2D.py and dataset/viewRGB.py hunks from that same original commit belong with the Dataset hierarchy PR instead.
Extracted from e2bc651; the dataset/braindata.py hunk from that same original commit belongs with the Dataset hierarchy PR instead.
Extracted from 7a1fb69; the dataset/braindata.py, dataset/viewRGB.py, and webgl/data.py hunks from that same original commit belong with the Dataset hierarchy and webgl PRs instead.
…ypy Wave 3) scipy.ndimage.interpolation.affine_transform is a deprecated shim typed as returning `object`, which mypy then can't follow through `.T`. Import from scipy.ndimage instead, and narrow anat2epispace's `order` param to the Literal[0..5] scipy actually accepts.
…d711d8b Extracted from fd711d8b; the dataset/braindata.py and utils.py hunks from that same original commit belong with the Dataset hierarchy and utils PRs instead. The database.py hunk is deferred to later in this branch's history, at the point in PR 4's own commit sequence where it originally landed (item 17 of 22).
Extracted from fffcb00; the svgoverlay.py hunk from that same original commit belongs with the svgoverlay PR instead.
Extracted from 4b97b45; the dataset/views.py hunk from that same original commit belongs with the Dataset hierarchy PR instead.
Extracted from 137d9e7; the export/save_views.py, mapper/patch.py, mapper/point.py, polyutils/misc.py, webgl/serve.py, and webgl/view.py hunks from that same original commit belong with their respective PRs instead.
Extracted from 410454d; the brainctm.py hunk from that same original commit belongs with the CTM/webgl PR instead.
Extracted from fd711d8b (see also the earlier xfm/align commit in this branch, which added Transform.reference_nifti itself); the dataset/braindata.py and utils.py hunks from that same original commit belong with the Dataset hierarchy and utils PRs instead.
Extracted from 245d95ff; the sha1(str) crash fix from this same original commit moved to PR 0 and is deliberately not included here. Keeps the Literal narrowing on get_anat's order / get_surf's hemi, the cast() to Nifti1Image, and the targeted type: ignore comments on the self.auxfile fallback pattern.
Also fixes a string type bug, and type overloading for Dataset.get_surf Ported from 9abb080 (types-data branch) / bb81c50a (types-easy).
kroq-gar78
force-pushed
the
types/01-03-04-infra-geometry-database
branch
from
August 18, 2026 08:25
5b3496d to
4556e6d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds type annotations to the subject surface database and associated transforms. It should have no behavioral changes.
It does make an assumption that the transform is a Nifti1 image. I can loosen that restriction: https://github.com/gallantlab/pycortex/pull/667/changes#diff-4df9c9b662d253d17cbbbbec9abe960e9ff277d48207bf98134266747f260cc8R42
Stack created with GitHub Stacks CLI • Give Feedback 💬