I am not aware of any matplotlib internal representation that can be
used. Moreover I was left with the impression that comparison of final
images is exactly what the matplotlib team does in their unittests.
The ipython notebook also uses final images (png or svg). The same
goes for matplotlib's example pages (png files).

Maybe this should be double posted on the matplotlib mailing list. I
know too little about their internals.

On 9 February 2012 22:29, Aaron Meurer <asmeu...@gmail.com> wrote:
> I was thinking this as well.  Though it might not just be for tests (e.g.,
> examples as well). That's why I asked what they are used for.
>
> Aaron Meurer
>
> On Feb 9, 2012, at 2:19 PM, Matthew Rocklin <mrock...@gmail.com> wrote:
>
> Is there an intermediate format in matplotlib to which we can compare? It
> seems odd to compare images that are generated by an external library.
> Couldn't a change in matplotlib cause our tests to fail?
>
> On Feb 9, 2012 12:26 PM, "krastanov.ste...@gmail.com"
> <krastanov.ste...@gmail.com> wrote:
>>
>> On 9 February 2012 21:12, Aaron Meurer <asmeu...@gmail.com> wrote:
>> > I just did a git clone, and everything, including the checkout is 52MB.
>> >
>> > Is it possible to use SVG versions of the images?  That should be much
>> > smaller, I would think, as the plots are vector images anyway.  Also,
>> > git will handle any diffs on a SVG much better than from a binary
>> > file.
>> >
>> > What are these images used for?
>> During the tests a number of images are generated. Those are then
>> compared to the saved reference images.
>> I have tried several comparison methods:
>>  - bit by bit - it does not work (both for png and svg)
>>  - string comparison for svg but only after removing all randomly
>> generated ids and hrefs (ok, tested only on one machine, but gives an
>> enormous number of lines of code in all tracking software (git,
>> github, loc counters))
>>  - histogram comparison for png - it is the method used in the
>> upstream matplotlib testing framework. I am calculating the histograms
>> and then comparing them with some hardcoded tolerance. I imagine that
>> instead of saving entire png files I can save only the histogram.
>>
>> So as possible solutions I propose:
>> - using svg (but it will give an enormous loc count)
>> - saving only the histograms of the pngs (quite small and nice but
>> difficult to verify in case of failure, when the failure is just due
>> to insufficient tolerance during the comparison (you can not compare
>> them with your own eyes))
>> - sticking to png and using sizes that are a bit smaller (but not too
>> much)
>>
>> I prefer the second or third method because otherwise git will report
>> tens of thousands of loc.
>>
>> A similar problem is present in the notebooks in the example folder.
>> Notebooks with figures tend to be big.
>>
>> >
>> > Aaron Meurer
>> >
>> > On Thu, Feb 9, 2012 at 12:42 PM, krastanov.ste...@gmail.com
>> > <krastanov.ste...@gmail.com> wrote:
>> >> Hi,
>> >>
>> >> The new plotting module tests keep a number of reference png images
>> >> for comparison. ~20 images each ~200KB is more than the size of our
>> >> code base. I do not know it it will be a good decision to burden git
>> >> with those. What do you think?
>> >>
>> >> Stefan
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups "sympy" group.
>> >> To post to this group, send email to sympy@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> sympy+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/sympy?hl=en.
>> >>
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "sympy" group.
>> > To post to this group, send email to sympy@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > sympy+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/sympy?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sympy" group.
>> To post to this group, send email to sympy@googlegroups.com.
>> To unsubscribe from this group, send email to
>> sympy+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/sympy?hl=en.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To post to this group, send email to sympy@googlegroups.com.
> To unsubscribe from this group, send email to
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sympy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to