astropy/astropy — pull request #1251 by adonath (2013-07-12 12:04:27+00:00)
Title: New models, model testing and Parameric2DModel base class

This is a follow up PR to #1203.
At first I've implemented a new Parametric2DModel class, which is the base class for all 2D Models.

Than I've coded a few more 1D and 2D models. Including Box, Trapezoid, MexicanHat, mainly models
which are needed for the convolution kernel class (I will open a second PR for the convolution kernel class today...)

To have proper testing for all of these models, I've restructured "test_model.py" a bit. The main difference is, that
there is an additional file "model_lists.py" in the test folder, where all the models test values and test parameters are coded in a dictionary (this is more readable than simple lists in between the code and I assume it will get much longer in the future). Every model in this list is automatically tested for returning the right values, when called and for working with the NonLinearLSQFitter.

To make implementing new models still easier, I've written an IPython notebook, where you can calculate model
test values and derivatives with SymPy. It also outputs a Latex string for the model docstring and shows
the model formula with symbols, which is a great test, to see if the model formula is correct. I think it would
be useful for everyone, who wants to implement new models. What would be the best place to put this notebook?
Currently it is just in the modeling/tests folder.

The work is "almost finished": Some models are only tested with one single value and most Latex model formulae
in the docstrings are missing. But this can be easily done with the Notebook.

I'm looking forward to any comments!