[yt-dev] Simple answer testing now in 3.0

Britton Smith brittonsmith at gmail.com
Mon Jan 27 07:50:52 PST 2014


Hi all,

I just want to emphasize that this can be used for a couple really
important things:
1. While developing a new piece of machinery, make a reference of results
once you feel like whatever you're working on is giving the right answer.
 Then, you can use this to continually test that as you work on things,
like optimization, that shouldn't change the answers you're getting.
2. If you want to know whether an incoming pull request changes something
you're working on, run a test and create some reference answers, then pull
in the PR, rerun the test, and compare.

This second thing is something that just about anyone can do to help out
with testing and evaluating of PRs.  If you have some functionality that
isn't a part of the standard test suite, then doing this can be extremely
valuable.

Britton


On Mon, Jan 27, 2014 at 1:05 PM, Matthew Turk <matthewturk at gmail.com> wrote:

> Hi all,
>
> Just as a quick note, Britton, Nathan and I came up with a very simple
> answer testing mechanism.  Originally we did this for the unit
> refactor.  Here's the PR, with some explanation:
>
>
> https://bitbucket.org/MatthewTurk/yt/pull-request/36/adding-simple-answer-testing
>
> This will be added to the docs soon, but the long and the short is
> that if you can define a function that returns an array, you can
> easily check that the answer remains the same by comparing
> min,max,sum,std,size, and (optionally) the hash.  You just have to do
> something like this:
>
> http://paste.yt-project.org/show/4239/
>
> or,
>
> http://paste.yt-project.org/show/4245/
>
> If you run with --answer-reference on the command line, it stores, and
> if not, it compares.  It'll also pop off a result_basename kwarg to
> the function in case you want to run it multiple times with different
> result names.
>
> Anyway, I've just pushed it into the main 3.0 branch, and at some
> point it should probably be added to the 2.x branch too.
>
> -Matt
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20140127/97bf2ef8/attachment.htm>


More information about the yt-dev mailing list