Downloading and Installation¶
The lmfit package requires Python, Numpy, and Scipy.
Lmfit works with Python 2.7, 3.3, 3.4, and 3.5. Lmfit version 0.9.4 works with Python 2.6, but support for it will dropped in version 0.9.5. Scipy version 0.13 or higher is required, with 0.17 or higher recommended to be able to use the latest optimization features from scipy. Support for scipy 0.13 will be dropped in version 0.9.5. Numpy version 1.5 or higher is required.
In order to run the test suite, the nose framework is required. Some parts of lmfit will be able to make use of IPython (version 4 or higher), matplotlib, and pandas if those libraries are installed, but no core functionality of lmfit requires these.
If you have pip installed, you can install lmfit with:
pip install lmfit
or you can download the source kit, unpack it and install with:
python setup.py install
For Anaconda Python, lmfit is not an official packages, but several Anaconda channels provide it, allowing installation with (for example):
conda install -c newville lmfit
To get the latest development version, use:
git clone http://github.com/lmfit/lmfit-py.git
and install using:
python setup.py install
A battery of tests scripts that can be run with the nose testing
framework is distributed with lmfit in the
tests folder. These are
routinely run on the development version. Running
nosetests should run
all of these tests to completion without errors or failures.
Many of the examples in this documentation are distributed with lmfit in
examples folder, and should also run for you. Many of these require
Many people have contributed to lmfit. Matthew Newville wrote the original version and maintains the project. Till Stensitzki wrote the improved estimates of confidence intervals, and contributed many tests, bug fixes, and documentation. Daniel B. Allan wrote much of the high level Model code, and many improvements to the testing and documentation. Antonino Ingargiola wrote much of the high level Model code and provided many bug fixes. J. J. Helmus wrote the MINUT bounds for leastsq, originally in leastsqbounds.py, and ported to lmfit. E. O. Le Bigot wrote the uncertainties package, a version of which is used by lmfit. Michal Rawlik added plotting capabilities for Models. A. R. J. Nelson added differential_evolution, emcee, and greatly improved the code in the docstrings. Additional patches, bug fixes, and suggestions have come from Christoph Deil, Francois Boulogne, Thomas Caswell, Colin Brosseau, nmearl, Gustavo Pasquevich, Clemens Prescher, LiCode, and Ben Gamari. The lmfit code obviously depends on, and owes a very large debt to the code in scipy.optimize. Several discussions on the scipy-user and lmfit mailing lists have also led to improvements in this code.
The LMFIT-py code is distribution under the following license: