lmfit/lmfit-py — pull request #68 by danielballan (2013-12-17 03:06:32+00:00)
Title: Model addition, predefined subclass Models, and lots of unit tests

Wheeeee....

Predefined ``Model`` subclasses in ``lmfit.models``:

'Constant',
'Linear',
'Parabolic',
'Quadratic', # synonym for Parabolic
'Polynomial',
'Exponential',
'Gaussian',
'NormalizedGaussian',
'PowerLaw'

Model addition:

>>> model = Model(user_defined_func, independent_var=['x']) + Model(another_user_func, ['x'])

>>> model = Gaussian(['x']) + Constant()

>>> model = PowerLaw(['x'] + Polynomial(4, ['x']) # specify any order polynomial

>>> model = Gaussian(['x']) + Gaussian(['x']) # raises error because parameter names conflict

>>> model = Gaussian(['x']) + Gaussian(['x'], suffix='2') # works fine

There are unit tests for all.

TODO:

* Automatic "guessing" as in ``models1d.py``. This will require some messing with the API...currently, Model raises if the user fails to specify any parameters.

* More models.