Releases: lmfit/lmfit-py
1.3.4
Mostly maintenance and small bug fixes:
- capture and ignore std_dev=0 warnings from uncertainties package
- better ensure that parameter values and sterr are floats, not np.floats
- fix Doniach formula in docstring (#966)
- add bose and fermi lineshapes, and BoseModel and FermiModel (with tests)
- remove deprecated disp argument for ampgo
- fix typos in README.rst
- fix typos in doc
- update to latest SciPy/NumPy version
- update pre-commit and CI hooks
- update zenodo link
- several fixes for deprecations and test failures
- do not test for warnings from upstream code that might change or be suppressed or altered
- update license name for PyPI compatibiilty
1.3.3
Fixes:
- fix loading spline models with more than five knots (Issue #985)
- improved SplineModel to explicitly allow more knots, make it easier to evaluate and save/reload (Issue #985 PR #989, Paul Müller)
- improvements to adding Parameters.
- support Model functions with "barestar" syntax (PR #982)
- fix several related problems with providing a Jacobian function, especially for consistency across solvers (including least_squares), and for pickling (PR #973 Ville Yrjänä)
- fix Step and Rectangle Models to allow a negative value for sigma, indicating a downward step (PR #970)
Build, Maintenance:
- update issue templates
- add test for consistent init_fit and best_fit for saved/looded SplineModel
- fix NumPy v2 DeprecationWarning
- uppdate SciPy/NumPy dependencies.
- remove numexpr dependency (again)
- drop support for Python 3.8, add Python 3.13
- asteval no longer raises NameError to Python, so we catch exceptions from asteval when creating parameters.
- avoid setting
stderrtoNonefor uncertainties calculations.
Documentation and Examples:
- add example with uncertainties in both x and y (#992)
- make sign of residual calculations in model.py consistent with documentation (Discussion #986, PR#987, Timothy-J-Warner)
- add example fitting multiple datasets using Model interface (Discussion #904, PR #967, mstekiel)
- tweaks to 'sphinx-gallery' settings.
- update names of the documentation examples in Gallery
1.3.2
Fixes:
- fix typo in restoring a
_buildmodeldict (PR #957, Issue #956) - fixes for Numpy2 support (PR #959, Issue #958)
- ensure that correct initial params are used when re-fitting a ModeRresult (PR #961, Issue #960)
- make sure that CompositeModels cannot have a prefix (PR #961, Issue #954)
Build, Maintenance:
- update pre-commit hooks, adding codespell exceptions
- update to latest SciPy/NumPy versions, including dependency versions for NumPy 2.
- now require asteval>=1.0 and uncertainties>=3.2.2
1.3.1
Mostly fixes for bugs introduced in 1.3.0
-
allow
Model.eval_uncertaintyto be performed with single points forxindependent variables (PR #952, Issue #951) -
allow
Model._parse_paramto handle older-style passed-in 'argnames' and 'kwargs' as for variadic function, add test (PR #950) -
better allow (or re-allow) Model function independent variables / keyword argumentss to be given non-default values at model creation time
-
add
formas independent variable for builtin Step, Rectangle, Thermal Distribution models. -
use a copy of
sys.moduleswhen iterating over it. (#949) -
use
Model._reprstring(long=True)for modelModel.__repr__().
1.3.0
Version 1.3.0 Release Notes (April 4, 2024)
New features:
-
add
'min_rel_change'as optional variable in calculation of confidence intervals with
Model.conf_interval(). (PR #937). -
Model.eval_uncertaintynow takes an optionaldscaleparameter (default value of 0.01) to
set the step size for calculating derivatives (PR #933). -
add calculation of
predicted_intervaltoModel.eval_uncertainty(PR #933).
Bug fixes/enhancements:
-
restore best-fit parameter values for high accuracy values of constrained values (PR #907)
-
improvement to Model for the difference between Parameter, "independent variable", and
"option". With this change, keyword arguments to model functions with non-numerice
default values such asdo_thing=True, orform='linear'has those arguments
become clearly identified as independent variables,and use the provided values as
default values. (PR #941) -
better saving/loading saved states of Model now use dill, have several cleanups, and
are now versioned for future-proofing. Also, propagate funcdets for Parameters when
loading a Model. (PR #932, PR #934) -
in the TNC method,
maxfunis used instead ofmaxiter. -
fix bug calculating r-squared for fits with weights (PR #921, PR #923)
-
fix bug in
modelresult.eval_uncertainty()afterload_modelresult()(PR #909) -
use StringIO for
pandas.read_json. -
add test for MinimizerResult.uvars after successful fit (PR #913)
-
adding an example using basinhopping, can take other methods as command-line argument
Maintenance/Deprecations:
-
drop support for Python 3.7 that reached EOL on 2023-06-27 (PR #927)
-
fix tests for Python 3.12 and Python 3.13-dev
-
increase minimum numpy verstio to 1.23 and scipy to 1.8.
-
updates for compatibility with numpy 2.0
-
the
dillpackage is now required. (#940) -
build switchded to use pyproject.toml (#928)
-
fix broken links in Examples gallery
-
fix intersphinx mapping to scipy docs.
1.2.2
Version 1.2.2 Release Notes (July 14, 2023)
New features:
-
add
ModelResult.uvarsoutput to aModelResultafter a successful fit
that containsufloatsfrom theuncertaintiespackage which can be
used for downstream calculations that propagate the uncertainties (and
correlations) of the variable Parameters. (PR #888) -
Outputs of residual functions, including
Model._residual, are more
explicitly coerced to 1d-arrays of datatype Float64. This decreases the
expectation for the user-supplied code to return ndarrays, and increases the
tolerance for more "array-like" objects or ndarrays that are not Float64 or
1-dimensional. (PR #899) -
Model.fitnow takes acoerce_farrayoption, defaulting toTrueto
control whether to input data and independent variables that are "array-like"
are coerced to ndarrays of datatype Float64 or Complex128. If set to
Falsethen independent data that "array-like" (pandas.Series, int32
arrays, etc) will be sent to the model function unaltered. The user may then
use other features of these objects, but may also need to explicitly coerce
the datatype of the result the change described above about coercing the
result causes problems. (Discussion #873; PR #899)
Bug fixes/enhancements:
-
fixed bug in
Model.make_params()for non-composite models that use a
prefix (Discussion #892; Issue #893; PR #895) -
fixed bug with aborted fits for several methods having incorrect or invalid
fit statistics. (Discussion #894; Issue #896; PR #897) -
Model.eval_uncertaintynow correctly calculates complex (real/imaginary pairs)
uncertainties for Models that generate complex results. (Issue #900; PR #901) -
Model.evalnow returns and array-like value. This adds to the coercion
features above and fixes a bug for composite models that return lists (Issue #875; PR #901) -
the HTML representation for a
ModelResultorMinimizerResultare
improved, and create fewer entries in the Table of Contents for Jupyter lab.
(Issue #884; PR #883; PR #902)
1.2.2rc1
Version 1.2.2 Release Notes (July 14, 2023)
New features:
-
add
ModelResult.uvarsoutput to aModelResultafter a successful fit
that containsufloatsfrom theuncertaintiespackage which can be
used for downstream calculations that propagate the uncertainties (and
correlations) of the variable Parameters. (PR #888) -
Outputs of residual functions, including
Model._residual, are more
explicitly coerced to 1d-arrays of dataype Float64. This decreases the
expectation for the user-supplied code to return ndarrays, and increases the
tolerance for more "array-like" objects or ndarrays that are not Float64 or
1-dimensional. (PR #899) -
Model.fitnow takes acoerce_farrayoption, defaulting toTrueto
control whether to input data and independent variables that are "array-like"
are coerced to ndarrays of datatype Float64 or Complex128. If set to
Falsethen independent data that "array-like" (pandas.Series, int32
arrays, etc) will be sent to the model function unaltered. The user may then
use other features of these objects, but may also need to explicitly coerce
the datatype of the result the change described above about coercing the
result causes problems. (Discussion #873; PR #899)
Bug fixes/enhancements:
-
fixed bug in
Model.make_params()for non-composite models that use a
prefix (Discussion #892; Issue #893; PR #895) -
fixed bug with aborted fits for several methods having incorrect or invalid
fit statistics. (Discussion #894; Issue #896; PR #897) -
Model.eval_uncertaintynow correctly calculates complex (real/imaginary pairs)
uncertainties for Models that generate complex results. (Issue #900; PR #901) -
Model.evalnow returns and array-like value. This adds to the coercion
features above and fixes a bug for composite models that return lists (Issue #875; PR #901) -
the HTML representation for a
ModelResultorMinimizerResultare
improved, and create fewer entries in the Table of Contents for Jupyter lab.
(Issue #884; PR #883; PR #902)
1.2.1
Version 1.2.1 Release Notes (May 02, 2023)
Bug fixes/enhancements:
1.20
New features:
- add
create_paramsfunction (PR #844) - add
chi2_outandnsigmaoptions toconf_interval2d() - add
ModelResult.summary()to return many resulting fit statistics and attributes into a JSON-able dict. - add
correl_table()function tolmfit.printfuncsandcorrel_modeoption tofit_report()and
ModelResult.fit_report()to optionally display a RST-formatted table of a correlation matrix.
Bug fixes/enhancements:
- fix bug when setting
param.vary=Truefor a constrained parameter (Issue #859; PR #860) - fix bug in reported uncertainties for constrained parameters by better propating uncertainties (Issue #855; PR #856)
- Coercing of user input data and independent data for
Modelto float64 ndarrays is somewhat less aggressive and
will not increase the precision of numpy ndarrays (see :ref:model_data_coercion_sectionfor details). The resulting
calculation from a model or objective function is more aggressively coerced to float64. (Issue #850; PR #853) - the default value of
epsfcnis increased to 1.e-10 to allow for handling of data with precision less than float64
(Issue #850; PR #853) - fix
conf_interval2dto use "increase chi-square by sigma**2*reduced chi-square" to give thesigma-level
probabilities (Issue #848; PR #852) - fix reading of older
ModelResult(Issue #845; included in PR #844) - fix deepcopy of
Parametersand user data (mguhyo; PR #837) - improve
Model.make_paramsandcreate_paramsto take optional dict of Parameter attributes (PR #844) - fix reporting of
nfevfromleast_squaresto better reflect actual number of function calls (Issue #842; PR #844) - fix bug in
Model.evalwhen mixing parameters and keyword arguments (PR #844, #839) - re-adds
residualto savedModelresult (PR #844, #830) ConstantModelandComplexConstantModelwill return an ndarray of the same shape as the independent variable
x(JeppeKlitgaard, Issue #840; PR #841)- update tests for latest versions of NumPy and SciPy.
- many fixes of doc typos and updates of dependencies, pre-commit hooks, and CI.
1.2.0rc1: Merge pull request #858 from lmfit/v120_rc1
Version 1.2.0rc1 Release Notes (April 03, 2023)
New features:
- add
create_paramsfunction (PR #844) - add
chi2_outandnsigmaoptions toconf_interval2d() - add
ModelResult.summary()to return many resulting fit statistics and attributes into a JSON-able dict. - add
correl_table()function tolmfit.printfuncsandcorrel_modeoption tofit_report()and
ModelResult.fit_report()to optionally display a RST-formatted table of a correlation matrix.
Bug fixes/enhancements:
- fix bug in reported uncertainties for constrained parameters by better propating uncertainties (Issue #855; PR #856)
- Coercing of user input data and independent data for
Modelto float64 ndarrays is somewhat less aggressive and
will not increase the precision of numpy ndarrays (see :ref:model_data_coercion_sectionfor details). The resulting
calculation from a model or objective function is more aggressively coerced to float64. (Issue #850; PR #853) - the default value of
epsfcnis increased to 1.e-10 to allow for handling of data with precision less than float64
(Issue #850; PR #853) - fix
conf_interval2dto use "increase chi-square by sigma**2*reduced chi-square" to give thesigma-level
probabilities (Issue #848; PR #852) - fix reading of older
ModelResult(Issue #845; included in PR #844) - fix deepcopy of
Parametersand user data (mguhyo; PR #837) - improve
Model.make_paramsandcreate_paramsto take optional dict of Parameter attributes (PR #844) - fix reporting of
nfevfromleast_squaresto better reflect actual number of function calls (Issue #842; PR #844) - fix bug in
Model.evalwhen mixing parameters and keyword arguments (PR #844, #839) - re-adds
residualto savedModelresult (PR #844, #830) ConstantModelandComplexConstantModelwill return an ndarray of the same shape as the independent variable
x(JeppeKlitgaard, Issue #840; PR #841)- update tests for latest versions of NumPy and SciPy.
- many fixes of doc typos and updates of dependencies, pre-commit hooks, and CI.