forked from pool/python-lmfit
Matej Cepl
3434fdbedb
- Update to v1.1.0 ## New features: * add Pearson4Model (@lellid; PR #800) * add SplineModel (PR #804) * add R^2 rsquared statistic to fit outputs and reports for Model fits (Issue #803; PR #810) * add calculation of dely for model components of composite models (Issue #761; PR #826) ## Bug fixes/enhancements: * make sure variable spercent is always defined in params_html_table functions (reported by @MySlientWind; Issue #768, PR #770) * always initialize the variables success and covar the MinimizerResult (reported by Marc W. Pound; PR #771) * build package following PEP517/PEP518; use pyproject.toml and setup.cfg; leave setup.py for now (PR #777) * components used to create a CompositeModel can now have different independent variables (@Julian-Hochhaus; Discussion #787; PR #788) * fixed function definition for StepModel(form='linear'), was not consistent with the other ones (@matpompili; PR #794) * fixed height factor for Gaussian2dModel, was not correct (@matpompili; PR #795) * for covariances with negative diagonal elements, we set the covariance to None (PR #813) * fixed linear mode for RectangleModel (@arunpersaud; Issue #815; PR #816) * report correct initial values for parameters with bounds (Issue #820; PR #821) * allow recalculation of confidence intervals (@jagerber48; PR OBS-URL: https://build.opensuse.org/request/show/1058273 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-lmfit?expand=0&rev=7
102 lines
3.7 KiB
RPMSpec
102 lines
3.7 KiB
RPMSpec
#
|
|
# spec file for package python-lmfit
|
|
#
|
|
# Copyright (c) 2023 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: python-lmfit
|
|
Version: 1.1.0
|
|
Release: 0
|
|
Summary: Least-Squares Minimization with Bounds and Constraints
|
|
License: BSD-3-Clause AND MIT
|
|
URL: https://lmfit.github.io/lmfit-py/
|
|
Source: https://files.pythonhosted.org/packages/source/l/lmfit/lmfit-%{version}.tar.gz
|
|
BuildRequires: %{python_module base >= 3.7}
|
|
BuildRequires: %{python_module pip}
|
|
BuildRequires: %{python_module setuptools_scm}
|
|
BuildRequires: %{python_module setuptools}
|
|
BuildRequires: %{python_module wheel}
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-macros
|
|
Requires: python-asteval >= 0.9.28
|
|
Requires: python-numpy >= 1.19
|
|
Requires: python-scipy >= 1.6
|
|
Requires: python-uncertainties >= 3.1.4
|
|
Recommends: python-dill
|
|
Recommends: python-emcee
|
|
Recommends: python-matplotlib
|
|
Recommends: python-pandas
|
|
BuildArch: noarch
|
|
# SECTION test requirements
|
|
BuildRequires: %{python_module asteval >= 0.9.28}
|
|
BuildRequires: %{python_module numpy >= 1.19}
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module scipy >= 1.6}
|
|
BuildRequires: %{python_module uncertainties >= 3.1.4}
|
|
# /SECTION
|
|
%python_subpackages
|
|
|
|
%description
|
|
A library for least-squares minimization and data fitting in
|
|
Python. Built on top of scipy.optimize, lmfit provides a Parameter object
|
|
which can be set as fixed or free, can have upper and/or lower bounds, or
|
|
can be written in terms of algebraic constraints of other Parameters. The
|
|
user writes a function to be minimized as a function of these Parameters,
|
|
and the scipy.optimize methods are used to find the optimal values for the
|
|
Parameters. The Levenberg-Marquardt (leastsq) is the default minimization
|
|
algorithm, and provides estimated standard errors and correlations between
|
|
varied Parameters. Other minimization methods, including Nelder-Mead's
|
|
downhill simplex, Powell's method, BFGS, Sequential Least Squares, and
|
|
others are also supported. Bounds and constraints can be placed on
|
|
Parameters for all of these methods.
|
|
|
|
In addition, methods for explicitly calculating confidence intervals are
|
|
provided for exploring minmization problems where the approximation of
|
|
estimating Parameter uncertainties from the covariance matrix is
|
|
questionable.
|
|
|
|
%prep
|
|
%setup -q -n lmfit-%{version}
|
|
sed -i -e '/^#!\//, 1d' lmfit/jsonutils.py
|
|
# only coverage related pytest flags here. remove
|
|
sed -i '/addopts/d' setup.cfg
|
|
|
|
%build
|
|
%pyproject_wheel
|
|
|
|
%install
|
|
%pyproject_install
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
|
|
|
%check
|
|
# We don't care about speed on obs
|
|
donttest="speed"
|
|
# these tests fail on non x86_64. Upstream does not care: https://github.com/lmfit/lmfit-py/issues/692
|
|
donttest+=" or test_model_nan_policy"
|
|
donttest+=" or test_shgo_scipy_vs_lmfit_2"
|
|
# fails on 32-bit
|
|
if [ $(getconf LONG_BIT) -ne 64 ]; then
|
|
donttest+=" or (test_itercb_minimizer_class and leastsq and False)"
|
|
fi
|
|
%pytest -k "not ($donttest)"
|
|
|
|
%files %{python_files}
|
|
%doc README.rst AUTHORS.txt
|
|
%license LICENSE
|
|
%{python_sitelib}/lmfit
|
|
%{python_sitelib}/lmfit-%{version}*-info
|
|
|
|
%changelog
|