forked from pool/python-lmfit
Markéta Machová
5cfc2ad4f7
- Update to 1.2.2 * add create_params function * add ModelResult.summary() to return many resulting fit statistics and attributes into a JSON-able dict. * update tests for latest versions of NumPy and SciPy. * Coercing of user input data and independent data for Model to float64 ndarrays is somewhat less aggressive and will not increase the precision of numpy ndarrays * improve Model.make_params and create_params to take optional dict of Parameter attributes * 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. OBS-URL: https://build.opensuse.org/request/show/1105049 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-lmfit?expand=0&rev=9
103 lines
3.7 KiB
RPMSpec
103 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.2.2
|
|
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)"
|
|
donttest+=" or (test_aborted_solvers and brute)"
|
|
fi
|
|
%pytest -k "not ($donttest)"
|
|
|
|
%files %{python_files}
|
|
%doc README.rst AUTHORS.txt
|
|
%license LICENSE
|
|
%{python_sitelib}/lmfit
|
|
%{python_sitelib}/lmfit-%{version}*-info
|
|
|
|
%changelog
|