This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Zac Hatfield-Dodds
Recipients Zac Hatfield-Dodds
Date 2020-05-18.09:10:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589793027.58.0.382499292423.issue40668@roundup.psfhosted.org>
In-reply-to
Content
As part of the Mentored Sprints at PyCon US, Marielle wrote some property-based tests [1] for the colorsys module [2], which found two bugs.


Taking a YIQ color, converting to RGB, and back to YIQ can result in the Y coordinate varying by more 0.1 (where [0, 1] is the range of possible values).
For example: (0.0 1.0 2.2204460492503136e-16) -> RGB -> (0.0 1.1102230246251568e-16 1.0)

Taking an RGB color and converting though HSV-RBG-HSV can result in very different saturation values - up to having S1==0 and S2==1.
For example: (0.0 1.0 2.2204460492503136e-16) -> RGB -> (0.0 1.1102230246251568e-16 1.0)


You can reproduce additional examples and get error bounds from [3].


[1] https://pyfound.blogspot.com/2020/05/property-based-testing-for-python.html
[2] https://docs.python.org/3/library/colorsys.html
[3] https://github.com/Zac-HD/stdlib-property-tests/pull/13
History
Date User Action Args
2020-05-18 09:10:27Zac Hatfield-Doddssetrecipients: + Zac Hatfield-Dodds
2020-05-18 09:10:27Zac Hatfield-Doddssetmessageid: <1589793027.58.0.382499292423.issue40668@roundup.psfhosted.org>
2020-05-18 09:10:27Zac Hatfield-Doddslinkissue40668 messages
2020-05-18 09:10:27Zac Hatfield-Doddscreate