Added documentation for ImageMorph module#9302
Added documentation for ImageMorph module#9302johnnygitgud wants to merge 10 commits intopython-pillow:mainfrom
Conversation
hugovk
left a comment
There was a problem hiding this comment.
Thank you for filling this gap in the docs!
Please can you check the Sphinx warnings?
ImageMorph.rst:13: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:13: WARNING: py:class reference target not found: MorphOp [ref.class]
ImageMorph.rst:54: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:59: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:62: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:83: WARNING: py:meth reference target not found: LutBuilder.get_lut [ref.meth]
ImageMorph.rst:83: WARNING: py:meth reference target not found: LutBuilder.load_lut [ref.meth]
ImageMorph.rst:83: WARNING: py:meth reference target not found: LutBuilder.save_lut [ref.meth]
ImageMorph.rst:87: WARNING: py:class reference target not found: MorphOp [ref.class]
ImageMorph.rst:90: WARNING: py:class reference target not found: MorphOp [ref.class]
ImageMorph.rst:90: WARNING: py:meth reference target not found: MorphOp.apply [ref.meth]
ImageMorph.rst:109: WARNING: py:meth reference target not found: MorphOp.match [ref.meth]
ImageMorph.rst:109: WARNING: py:meth reference target not found: MorphOp.get_on_pixels [ref.meth]
ImageMorph.rst:125: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:145: WARNING: py:mod reference target not found: _imagingmorph [ref.mod]
ImageMorph.rst:145: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:145: WARNING: py:class reference target not found: MorphOp [ref.class]
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
d6a379d to
feb6955
Compare
docs/reference/ImageMorph.rst
Outdated
|
|
||
| * ``1`` — pixel must be “on” | ||
| * ``0`` — pixel must be “off” | ||
| * ``-`` — “don’t care” value (ignored during matching) |
There was a problem hiding this comment.
@johnnygitgud considering that our existing documentation says
. or X - Ignore
what made you think that - was the ignore value?
|
|
||
| lb = ImageMorph.LutBuilder(op_name="corner") | ||
| lb.add_patterns(patterns) | ||
| lut = lb.build_lut() |
There was a problem hiding this comment.
This example doesn't work. It fails with
Traceback (most recent call last):
File "demo.py", line 10, in <module>
lut = lb.build_lut()
File "PIL/ImageMorph.py", line 156, in build_lut
raise Exception(msg)
Exception: Syntax error in pattern "10"
It is, for one thing, missing the 4/N/1/M operation. It feels like you haven't read
Lines 51 to 60 in 00e2198
If you haven't read the source code, that's kind of a red flag with a documentation suggestion.
Could you explain how you came up with this code?
|
Looking at https://pillow--9302.org.readthedocs.build/en/9302/reference/ImageMorph.html, I feel like the initial description duplicates part of the I've created #9349 as an alternative. |
|
#9349 has been merged instead. |
This pull request adds documentation for the ImageMorph module
For issue #713 ("Todo: Docs for ImageMorph").
The updated documentation has: