Skip to content

Revert type checking changes to Image class#1405

Closed
Copilot wants to merge 5 commits intoimage-html-reprfrom
copilot/sub-pr-1404
Closed

Revert type checking changes to Image class#1405
Copilot wants to merge 5 commits intoimage-html-reprfrom
copilot/sub-pr-1404

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Description

Reverted previous type checking improvements to the Image class based on maintainer feedback. The code has been restored to its original state from the base branch.

Changes

  • Reverted explicit return None statements in plot() method
  • Reverted docstring, return type annotation, and TypeError check in _repr_html_() method
  • Restored original assert statements

Checklist

  • I have read the CONTRIBUTING docs and have a developer setup ready
  • Changes are
    • Non-breaking (would not break existing functionality)
    • Breaking (would cause existing functionality to change)
  • Tests added or modified to cover the changes
  • In-line docstrings updated
  • Documentation updated
  • This pull request is ready to be reviewed

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 22, 2026 22:23
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
Copilot AI requested a review from fepegar January 22, 2026 22:29
Comment on lines 236 to 238
if not isinstance(fig, Figure):
message = f'Expected Figure, got {type(fig)}'
raise TypeError(message)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in commit e5be8a9. The assert statement has been restored.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo these changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copilot AI requested a review from fepegar January 24, 2026 23:20
@fepegar fepegar closed this Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants