msimet/Stile — pull request #15 by rmandelb (2014-06-10 19:10:15+00:00)
Title: #6 - tests of statistical quantities

I think this code is now ready for review. It includes the following:

(1) A ```Stats``` class (in ```stile_utils.py```) that can carry around the statistics associated with some array or list of values, like it's length, mean, median, etc.

(2) A ```StatsSysTest``` systematics tester, in ```sys_tests.py```. It calculates the statistics for whatever input array you give it, and outputs the results in the form of a ```Stats``` object. If you give it a ```verbose``` keyword it will print the results to the screen as well.

(3) A bunch of unit tests.

There are a few things I want to highlight that could result in further improvements, either now or in future -

* The first unit test for this class takes a while, like 6 seconds. I think that's okay, but it's on the edge of being too long. If I want it to be faster, I will have to reduce the precision of the test, or perhaps pick a distribution other than Gaussian so that it'll converge with fewer random numbers. Is 6s okay or should I worry about this more?

* I did not make an example in ```examples/``` or put an example code snippet in the docstring. Sorry if I missed any discussion about this, but do people want a new example in ```examples/``` for all new classes? Right now the unit tests themselves give a reasonable example of usage, but probably there should at least be something in the docstring. Thoughts?

* The number of quantities that is calculated is rather small: min, max, median, mean, standard deviation, variance, length of the array, and value at certain percentiles. I was going to add some other things like kurtosis and skew, but NumPy does not seem to have functions for these, and I think we agreed not to have scipy as a dependency - is that right? So I'd need to find some other way to compute them. Is there anything else that people think should be part of the "statistical quantity systematics test" by default?