Revert type checking changes to Image class#1405
Closed
Copilot wants to merge 5 commits intoimage-html-reprfrom
Closed
Revert type checking changes to Image class#1405Copilot wants to merge 5 commits intoimage-html-reprfrom
Copilot wants to merge 5 commits intoimage-html-reprfrom
Conversation
7 tasks
Co-authored-by: fepegar <12688084+fepegar@users.noreply.github.com>
Co-authored-by: fepegar <12688084+fepegar@users.noreply.github.com>
Co-authored-by: fepegar <12688084+fepegar@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add HTML repr for Image and Subject
Fix mypy type checking error in Image.plot() method
Jan 22, 2026
fepegar
requested changes
Jan 24, 2026
src/torchio/data/image.py
Outdated
Comment on lines
236
to
238
| if not isinstance(fig, Figure): | ||
| message = f'Expected Figure, got {type(fig)}' | ||
| raise TypeError(message) |
Contributor
Author
There was a problem hiding this comment.
Reverted in commit e5be8a9. The assert statement has been restored.
src/torchio/data/image.py
Outdated
Comment on lines
820
to
828
| return None | ||
| else: | ||
| from ..visualization import plot_volume # avoid circular import | ||
|
|
||
| figure = plot_volume(self, **kwargs) | ||
| if return_fig: | ||
| assert figure is not None | ||
| return figure | ||
| return None |
Contributor
Author
There was a problem hiding this comment.
Reverted in commit e5be8a9. The explicit return None statements have been removed.
Co-authored-by: fepegar <12688084+fepegar@users.noreply.github.com>
Copilot
AI
changed the title
Fix mypy type checking error in Image.plot() method
Revert type checking changes to Image class
Jan 24, 2026
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.
Description
Reverted previous type checking improvements to the
Imageclass based on maintainer feedback. The code has been restored to its original state from the base branch.Changes
return Nonestatements inplot()method_repr_html_()methodassertstatementsChecklist
CONTRIBUTINGdocs and have a developer setup ready✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.