[Matplotlib-devel] On testing with other FreeType versions

Jody Klymak jklymak at uvic.ca
Tue Dec 12 01:29:26 EST 2017


Another idea might be to make most text a unique color that then could be not included in some image diffs.  Sure there may be the occasional image that uses that colour but a few missed pixels won’t matter too much. 

Sent from my iPhone

> On Dec 11, 2017, at 6:20 PM, Elliott Sales de Andrade <quantum.analyst at gmail.com> wrote:
> 
>> On 11 December 2017 at 00:44, Elliott Sales de Andrade <quantum.analyst at gmail.com> wrote:
>> Hi all,
>> 
>> Downstream in Fedora (and maybe Debian), they are running into issues with testing and text. Fedora 26 has FreeType 2.7.1 and Fedora 27 & Rawhide has FreeType 2.8. Fedora 25 uses 2.6.5, but it will be EOL in the next week. Many other distros are also transitioning to these newer FreeType as well [1] and I think anaconda recently added 2.8 too.
>> 
>> With 2.7.1, a few tests fail (rms < 1) and it is straightforward to patch that [2]. With 2.8 though, over 800 tests fail [3] ranging up to ~80 rms [4]. This is a bit harder to paper over.
>> 
>> I see a few ways to mitigate the problem, with varying advantages/disadvantages:
>> 
>> 1. Bundle the older version in the Matplotlib package like we do with tests. I don't really believe this to be a viable option for downstream, but I'm just mentioning it to be thorough. There are already a few (minor) security issues in the one we test against.
>> 2. Inject older FreeType just to run tests on the package. Again I don't like this idea. The point of running tests is to be sure that the version in a distro works *in that distro*. Testing with something a user could never install seems useless.
>> 3. Re-create all our current and future test images with 2.8. While this is most future-proof, adding over 800 images is going to bloat the repo quite a bit.
>> 4. Create some sort of side repo with test images for other FreeType releases. This would reduce bloat in the main repo but be somewhat more work. Thus I'd only suggest doing so for tags.
>> 
> 
> One more thing I forgot to mention is ImageHash [5] which is used by Iris for image tests using the following strategy [6]:
> using a perceptual 'image hash' of the outputs as the basis for checking test results.
> storing the hashes of 'known accepted results' for each test in a database in the repo
> storing associated reference images for each hash value in a separate public repository, allowing human-eye judgement of 'valid equivalent' results.
> a new version of the 'iris/tests/idiff.py' assists in comparing proposed new 'correct' result images with the existing accepted ones.
> While this does reduce load in the main repo itself, it does increase the cognitive load for developers. Iris has a small core group of developers and much fewer drive-by contributions compared to Matplotlib, so I'm not sure we want to be doing this full idea. (Note also their repo is LGPL3, so please don't copy anything from there.) Using ImageHash might still be useful instead of RMS, though it may generalize things too much.
> 
>> I dislike the first two options as they would be repetitive across distros (unless they just stopped testing altogether), but the last two are not without work for us.
>> 
>> Opinions? Alternative ideas?
>> 
>> [1] https://repology.org/metapackage/freetype/versions
>> [2] https://github.com/QuLogic/matplotlib/commit/cfdc835923407810bd087f60332cdc8cdcb23f05
>> [3] https://kojipkgs.fedoraproject.org//work/tasks/3137/23623137/build.log
>> [4] https://gist.github.com/QuLogic/477055a847a44cd444a0932432acffd1
> 
> [5] https://pypi.python.org/pypi/ImageHash
> [6] https://github.com/SciTools/iris/blob/master/docs/iris/src/developers_guide/graphics_tests.rst#graphics-testing-strategy
> 
> -- 
> Elliott
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20171211/26301dcb/attachment-0001.html>


More information about the Matplotlib-devel mailing list