Downloading and Installation¶
Lmfit works with Python versions 2.7, 3.3, 3.4, 3.5, and 3.6. Support for Python 2.6 ended with lmfit version 0.9.4. Scipy version 0.15 or higher is required, with 0.17 or higher recommended to be able to use the latest optimization features. NumPy version 1.5.1 or higher is required.
In order to run the test suite, either the nose or pytest package is required. Some functionality of lmfit requires the emcee package, some functionality will make use of the pandas, Jupyter or matplotlib packages if available. We highly recommend each of these packages.
pip now widely avaliable, you can install lmfit with:
pip install lmfit
Alternatively, you can download the source kit, unpack it and install with:
python setup.py install
For Anaconda Python, lmfit is not an official package, but several Anaconda channels provide it, allowing installation with (for example):
conda install -c conda-forge 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 either the nose or
pytest testing framework is distributed with lmfit in the
folder. These are automatically run as part of the development process.
For any release or any master branch from the git repository, 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. Some of these
examples assume matplotlib has been installed and is working correctly.
Many people have contributed to lmfit. The attribution of credit in a project such as this is very difficult to get perfect, and there are no doubt important contributions missing or under-represented here. Please consider this file as part of the documentation that may have bugs that need fixing. Some of the largest and most important contributions (approximately in order of contribution in size to the existing code) are from: 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. A. R. J. Nelson added differential_evolution, emcee, and greatly improved the code, docstrings, and overall project. 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 has provided many bug fixes and improvements. Renee Otten wrote the brute force method, and has improved the code and documentation in many places. Michal Rawlik added plotting capabilities for Models. 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. Additional patches, bug fixes, and suggestions have come from Christoph Deil, Francois Boulogne, Thomas Caswell, Colin Brosseau, nmearl, Gustavo Pasquevich, Clemens Prescher, LiCode, Ben Gamari, Yoav Roam, Alexander Stark, Alexandre Beelen, and many others. 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: