Repository navigation
chore: annotate ImageCore and fix its docstring placeholders - #254
Merged
Merged
Conversation
Part of Issue 60. Annotates the remaining parameters and returns in ImageCore.py, adds an ImageOperand alias for the right operand of the operators, removes four AUTO_EDIT placeholders from docstrings, and gives the Image class a docstring (the text above it was a bare string). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Annotates
ImageCore.py, the largest gap in the type-hint work of Issue 60 (61 of 142 parameters and 7 of 132 returns were unannotated). Annotation and docstring changes only, no behaviour change.__mul__,__add__,__and__, comparisons and so on) takeother: ImageOperand, a new alias for what can be the right operand: anImage, an array or a scalar.__mod__and__imod__take anImageor a scalar, since they stack planes._binop,_logicalopand_unopare typed.sameastakesobject.__array_ufunc__and__array_function__,colordict,colororder2dict(which already acceptsNone),plane,print(file=),rprint,__init__(domain=, **kwargs),__getitem__andpixels_maskare typed.planeis typedint | str | list[int] | tuple[int, ...]because a list of names raisesValueError.colordict,colororder2dictandplanereassigned their parameter or loop variable to a different type, so they now use a new name.__mod__and__imod__use acast, because mypy cannot see thatsmb.isscalarnarrows the type. The four ordering comparisons carry a# type: ignore[misc]becausendarrayhas the reflected comparison.AUTO_EDITplaceholders are removed, and theImageclass has a docstring (the text above it was a bare string, so it was not one). Withautoclass_content = "both"it is shown above the__init__text in the docs.I left alone what is not part of this change: the 87
:seealso:fields and the 92Example:blocks, which AGENTS.md says to migrate gradually, anddraw_labelboxanddraw_text, whose examples are plots, notrunblock.mypy reports no issues and the full suite passes (2145 passed, 33 skipped). Parameter annotations across the package go from 86.8% to 89.9%, and
ImageCore.pyhas none missing.AI-assisted: written with Claude Code (Claude Sonnet 5.5) and reviewed by the maintainer.
🤖 Generated with Claude Code