Type public Epochs, Evoked, and io members fully#14056
Open
larsoner wants to merge 3 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Okay this PR diff is big, but it's simple enough at its core:
mne/io,mne/evoked.py, andmne/epochs.py, ensuring the test passesI had Claude Opus 4.8 work on the test, but I simplified it and checked it. I also had Claude do the drudge-work of putting all those type annotations inline. The test ensures they're correct, though, so this should make review a bit easier (hopefully)!
This adds a little bit of work to future contributions having to type-define two places (docstring + code), but I don't think that's too onerous. Someday if numpy/numpydoc#196 (or numpy/numpydoc#601) lands we could maybe DRY things again.
I think with this scaffolding in place, we're safe to move to typing other modules in a similar fashion (or by using typestubs as a first pass, which @drammock is going to look into IIRC). In the meantime, I suggest we add this since it should make things slightly nicer for our end-users.
I considered
pydoclintas a checker, but it is a static tool, so we need to get rid of%/docdictbefore we could pursue that.