Image comparison decorators outside matplotlib

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Image comparison decorators outside matplotlib

aepsil0n
Hello,

I am developing a toolkit to parse, analyse and plot some scientific
data using matplotlib. Among them are some application-specific plotting
functions that sort of extend matplotlib.

There are these nice image comparison decorators to test code like that
but I am not sure how to use them for unit testing outside the scope of
matplotlib itself. Is this use case intended and possible for the decorator?

I have experimented with this unsuccessfully in the following way:

There is a tests directory within my package with test functions
decorated like so

@image_comparison(baseline_images=['custom_function'])
def test_custom_function():
    # plot stuff...

When I run nosetests, it fails creating some output images in
result_images.

Copying the appropriate files according to [1] to
my_package/tests/baseline_images does not seem to have any effect. There
are neither *-expected* nor *_{pdf,svg}.png files in there, only
custom_function.{pdf,svg,png}. What am I doing wrong?

Eduard

[1] http://matplotlib.org/devel/testing.html

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: Image comparison decorators outside matplotlib

Paul Hobson-2
Eduard,

Did you make any progress on this? I'm trying to do the same thing and it's skipping my tests entirely.
-paul


On Thu, Oct 10, 2013 at 5:41 AM, Eduard Bopp <[hidden email]> wrote:
Hello,

I am developing a toolkit to parse, analyse and plot some scientific
data using matplotlib. Among them are some application-specific plotting
functions that sort of extend matplotlib.

There are these nice image comparison decorators to test code like that
but I am not sure how to use them for unit testing outside the scope of
matplotlib itself. Is this use case intended and possible for the decorator?

I have experimented with this unsuccessfully in the following way:

There is a tests directory within my package with test functions
decorated like so

@image_comparison(baseline_images=['custom_function'])
def test_custom_function():
    # plot stuff...

When I run nosetests, it fails creating some output images in
result_images.

Copying the appropriate files according to [1] to
my_package/tests/baseline_images does not seem to have any effect. There
are neither *-expected* nor *_{pdf,svg}.png files in there, only
custom_function.{pdf,svg,png}. What am I doing wrong?

Eduard

[1] http://matplotlib.org/devel/testing.html

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Reply | Threaded
Open this post in threaded view
|

Re: Image comparison decorators outside matplotlib

aepsil0n
No, Paul, I haven't really had the time to dig into it myself. I would
also appreciate it very much if anyone could provide an explanation, how
this works and whether it can be used like this.

Eduard

On 11/06/2013 07:55 PM, Paul Hobson wrote:

> Eduard,
>
> Did you make any progress on this? I'm trying to do the same thing and it's
> skipping my tests entirely.
> -paul
>
>
> On Thu, Oct 10, 2013 at 5:41 AM, Eduard Bopp <[hidden email]>wrote:
>
>> Hello,
>>
>> I am developing a toolkit to parse, analyse and plot some scientific
>> data using matplotlib. Among them are some application-specific plotting
>> functions that sort of extend matplotlib.
>>
>> There are these nice image comparison decorators to test code like that
>> but I am not sure how to use them for unit testing outside the scope of
>> matplotlib itself. Is this use case intended and possible for the
>> decorator?
>>
>> I have experimented with this unsuccessfully in the following way:
>>
>> There is a tests directory within my package with test functions
>> decorated like so
>>
>> @image_comparison(baseline_images=['custom_function'])
>> def test_custom_function():
>>     # plot stuff...
>>
>> When I run nosetests, it fails creating some output images in
>> result_images.
>>
>> Copying the appropriate files according to [1] to
>> my_package/tests/baseline_images does not seem to have any effect. There
>> are neither *-expected* nor *_{pdf,svg}.png files in there, only
>> custom_function.{pdf,svg,png}. What am I doing wrong?
>>
>> Eduard
>>
>> [1] http://matplotlib.org/devel/testing.html
>>
>>
>> ------------------------------------------------------------------------------
>> October Webinars: Code for Performance
>> Free Intel webinars can help you accelerate application performance.
>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
>> from
>> the latest Intel processors and coprocessors. See abstracts and register >
>> http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Matplotlib-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel