GalSim-developers/GalSim — pull request #64 by rmandelb (2012-04-02 15:09:55+00:00)
Title: #29 sbp unit tests

I think we are ready to merge in a preliminary set of unit tests for SBProfile. These tests compare results from python-wrapped SBProfile against results from the C++ version of SBProfile that Gary sent before making any changes for the GalSim project. The comparison is done at the image level, requiring agreement at the fifth decimal place. Additional diagnostics are run for each comparison (e.g., min/max pixel value, moments, etc.) but are only output if the image level comparison fails.

A few notes on things that are not included, which should eventually be tested in future:
* SBPixel, SBLaguerre (unless we are definitely not using it for anything), SBDeVaucouleurs
* more arbitrary parameter values - I chose a specific set of parameters, which are perhaps not general enough?

Also, this is probably my first non-trivial foray into python. The tests are probably not written very elegantly, though they do seem to do the job. Any suggestions on writing nicer python code will be very much appreciated!

A reminder on how to run the unit tests: you will need an executable called "nosetests" (which some people will automatically have on their system if they've installed something like Enthought python which includes a variety of useful python packages; otherwise, can install the python nose package to get it). If you have that executable, then you can run it without arguments while sitting in the tests/ directory. Use the -v flag if you want more information about what tests it's running.