ENH add types for dataset classes (BrainData, Dataview, ...) - #669
Draft
kroq-gar78 wants to merge 9 commits into
Draft
ENH add types for dataset classes (BrainData, Dataview, ...)#669kroq-gar78 wants to merge 9 commits into
kroq-gar78 wants to merge 9 commits into
Conversation
The mapper/mapper.py and webgl/data.py/webgl/view.py hunks of this original commit are owned by PR 6 and PR 9 respectively.
Consolidates the rest of PR 5's per-commit typing work (dataset/braindata.py, dataset/views.py, dataset/view2D.py, dataset/viewRGB.py, dataset/__init__.py, tests/test_dataset.py) into one commit rather than replaying the remaining ~15 original commits individually. Reason for the shortcut: several of these commits touch the same lines in a different real chronological order than PR_SPLIT_PLAN.md's "PR-internal commit order is chronological" claim assumes (e.g. `1d2164b5`, dated 2026-03-07 17:54, resolves ColormapDict's `cmap` TODO before `90acd0bd`, dated 2026-03-07 21:29, removes the now-unused ListedColormap import — but the plan lists 90acd0b at position 9 and 1d2164b at position 21). Replaying in the plan's listed order applies real hunks against a file shape they weren't authored against, which is how a silent bug (re-deleting an import still in use) almost landed in the first cherry-pick pass. This commit instead checks out the exact final state of each PR-5-owned file from `types-easy`, verified to produce zero diff against `types-easy` for every file in PR 5's file list.
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 partial type support for the dataset classes. A rework of the dataset class hierarchy is likely necessary for full type support, but this PR should still be useful for end users.
This makes no behavior changes besides adding some type guards (which would have triggered runtime errors anyway).
Stack created with GitHub Stacks CLI • Give Feedback 💬