From 25ca3857f9a3c126dab0af98ea544ca91abf73f2ad437744a78793e478b78350 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 16 Jun 2020 08:37:37 +0000 Subject: [PATCH] Accepting request 812430 from home:glaubitz:branches:devel:languages:python:numeric - Update to version 1.0.1 + New features: - added thermal distribution model and lineshape (PR #620; @mpmdean) - introduced a new argument ``max_nfev`` to uniformly specify the maximum number of function evalutions (PR #610) **Please note: all other arguments (e.g., ``maxfev``, ``maxiter``, ...) will no longer be passed to the underlying solver. A warning will be emitted stating that one should use ``max_nfev``.** - the attribute ``call_kws`` was added to the ``MinimizerResult`` class and contains the keyword arguments that are supplied to the solver in SciPy. + Bug fixes: - fixes to the ``load`` and ``__setstate__`` methods of the Parameter class - fixed failure of ModelResult.dump() due to missing attributes (Issue #611, PR #623; @mpmdean) - ``guess_from_peak`` function now also works correctly with decreasing x-values or when using pandas (PRs #627 and #629; @mpmdean) - the ``Parameter.set()`` method now correctly first updates the boundaries and then the value (Issue #636, PR #637; @arunpersaud) + Various: - fixed typo for the use of expressions in the documentation (Issue #610; @jkrogager) - removal of PY2-compatibility and unused code and improved test coverage (PRs #619, #631, and #633) - removed deprecated ``isParameter`` function and automatic conversion of an ``uncertainties`` object (PR #626) - inaccurate FWHM calculations were removed from built-in models, others labeled as estimates (Issue #616 and PR #630) - corrected spelling mistake for the Doniach lineshape and model (Issue #634; @rayosborn) - removed unsupported/untested code for IPython notebooks in lmfit/ui/* OBS-URL: https://build.opensuse.org/request/show/812430 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-lmfit?expand=0&rev=1 --- .gitattributes | 23 +++++++ .gitignore | 1 + lmfit-1.0.1.tar.gz | 3 + python-lmfit.changes | 152 +++++++++++++++++++++++++++++++++++++++++++ python-lmfit.spec | 123 ++++++++++++++++++++++++++++++++++ 5 files changed, 302 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 lmfit-1.0.1.tar.gz create mode 100644 python-lmfit.changes create mode 100644 python-lmfit.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/lmfit-1.0.1.tar.gz b/lmfit-1.0.1.tar.gz new file mode 100644 index 0000000..060b24a --- /dev/null +++ b/lmfit-1.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d249eb756899360f4d2a544c9458f47fc8f765ac22c09e099530585fd64e286e +size 258368 diff --git a/python-lmfit.changes b/python-lmfit.changes new file mode 100644 index 0000000..602e59b --- /dev/null +++ b/python-lmfit.changes @@ -0,0 +1,152 @@ +------------------------------------------------------------------- +Mon Jun 8 07:06:22 UTC 2020 - John Paul Adrian Glaubitz + +- Update to version 1.0.1 + + New features: + - added thermal distribution model and lineshape (PR #620; @mpmdean) + - introduced a new argument ``max_nfev`` to uniformly specify the maximum + number of function evalutions (PR #610) + **Please note: all other arguments (e.g., ``maxfev``, ``maxiter``, ...) + will no longer be passed to the underlying solver. A warning will be emitted + stating that one should use ``max_nfev``.** + - the attribute ``call_kws`` was added to the ``MinimizerResult`` class and + contains the keyword arguments that are supplied to the solver in SciPy. + + Bug fixes: + - fixes to the ``load`` and ``__setstate__`` methods of the Parameter class + - fixed failure of ModelResult.dump() due to missing attributes + (Issue #611, PR #623; @mpmdean) + - ``guess_from_peak`` function now also works correctly with decreasing + x-values or when using pandas (PRs #627 and #629; @mpmdean) + - the ``Parameter.set()`` method now correctly first updates the boundaries + and then the value (Issue #636, PR #637; @arunpersaud) + + Various: + - fixed typo for the use of expressions in the documentation + (Issue #610; @jkrogager) + - removal of PY2-compatibility and unused code and improved test + coverage (PRs #619, #631, and #633) + - removed deprecated ``isParameter`` function and automatic conversion of + an ``uncertainties`` object (PR #626) + - inaccurate FWHM calculations were removed from built-in models, others + labeled as estimates (Issue #616 and PR #630) + - corrected spelling mistake for the Doniach lineshape and model + (Issue #634; @rayosborn) + - removed unsupported/untested code for IPython notebooks in lmfit/ui/* +- from version 1.0.0 + + New features: + - no new features are introduced in 1.0.0. + + Improvements: + - support for Python 2 and use of the ``six`` package are removed. (PR #612) + + Various: + - documentation updates to clarify the use of ``emcee``. (PR #614) +- from version 0.9.15 + + New features, improvements, and bug fixes: + - move application of parameter bounds to setter instead of getter (PR #587) + - add support for non-array Jacobian types in least_squares + (Issue #588, @ezwelty in PR #589) + - add more information (i.e., acor and acceptance_fraction) about + emcee fit (@j-zimmermann in PR #593) + - "name" is now a required positional argument for Parameter class, + update the magic methods (PR #595) + - fix nvars count and bound handling in confidence interval + calculations (Issue #597, PR #598) + - support Python 3.8; requires asteval >= 0.9.16 (PR #599) + - only support emcee version 3 (i.e., no PTSampler anymore) (PR #600) + - fix and refactor prob_bunc in confidence interval calculations (PR #604) + - fix adding Parameters with custom user-defined symbols + (Issue #607, PR #608; thanks to @gbouvignies for the report) + + Various: + - bump requirements to LTS version of SciPy/ NumPy and code clean-up (PR #591) + - documentation updates (PR #596, and others) + - improve test coverage and Travis CI updates (PR #595, and others) + - update pre-commit hooks and configuration in setup.cfg + + To-be deprecated: + - function Parameter.isParameter and conversion from + uncertainties.core.Variable to value in _getval (PR #595) +- from version 0.9.14 + + New features: + - the global optimizers ``shgo`` and ``dual_annealing`` (new in SciPy v1.2) + are now supported (Issue #527; PRs #545 and #556) + - ``eval`` method added to the Parameter class (PR #550 by @zobristnicholas) + - avoid ZeroDivisionError in ``printfuncs.params_html_table`` + (PR #552 by @aaristov and PR #559) + - add parallelization to ``brute`` method (PR #564, requires SciPy v1.3) + + Bug fixes: + - consider only varying parameters when reporting potential issues with calculating + errorbars (PR #549) and compare ``value`` to both ``min`` and ``max`` (PR #571) + - guard against division by zero in lineshape functions and ``FWHM`` + and ``height`` expression calculations (PR #545) + - fix issues with restoring a saved Model (Issue #553; PR #554) + - always set ``result.method`` for ``emcee`` algorithm (PR #558) + - more careful adding of parameters to handle out-of-order + constraint expressions (Issue #560; PR #561) + - make sure all parameters in Model.guess() use prefixes (PRs #567 and #569) + - use ``inspect.signature`` for PY3 to support wrapped functions + (Issue #570; PR #576) + - fix ``result.nfev``` for ``brute`` method when using parallelization + (Issue #578; PR #579) + + Various: + - remove "missing" in the Model class (replaced by nan_policy) and "drop" + as option to nan_policy (replaced by omit) deprecated since 0.9 (PR #565). + - deprecate 'report_errors' in printfuncs.py (PR #571) + - updates to the documentation to use ``jupyter-sphinx`` to include + examples/output (PRs #573 and #575) + - include a Gallery with examples in the documentation + using ``sphinx-gallery`` (PR #574 and #583) + - improve test-coverage (PRs #571, #572 and #585) + - add/clarify warning messages when NaN values are detected (PR #586) + - several updates to docstrings (Issue #584; PR #583, and others) + - update pre-commit hooks and several docstrings +- Update BuildRequires and Requires from setup.py + +------------------------------------------------------------------- +Wed Apr 24 08:42:15 UTC 2019 - pgajdos@suse.com + +- version update to 0.9.13 + New features: + Clearer warning message in fit reports when uncertainties should + but cannot be estimated, including guesses of which Parameters + to examine (#521, #543) + SplitLorenztianModel and split_lorentzian function (#523) + HTML representations for Parameter, MinimizerResult, and Model + so that they can be printed better with Jupyter (#524, #548) + support parallelization for differential evolution (#526) + Bug fixes: + delay import of matplotlib (and so, the selection of its backend) + as late as possible (#528, #529) + fix for saving, loading, and reloading ModelResults (#534) + fix to leastsq to report the best-fit values, not the values tried + last (#535, #536) + fix synchronization of all parameter values on Model.guess() (#539, #542) + improve deprecation warnings for outdated nan_policy keywords (#540) + fix for edge case in gformat() (#547) + Project managements: + using pre-commit framework to improve and enforce coding style (#533) + added code coverage report to github main page + updated docs, github templates, added several tests. + dropped support and testing for Python 3.4. +- deleted patches + - lmfit-scipy.patch (upstreamed) + +------------------------------------------------------------------- +Tue Mar 5 14:57:02 UTC 2019 - Todd R + +- Fix spurious unit test errors. + +------------------------------------------------------------------- +Fri Jan 18 10:24:44 UTC 2019 - Tomáš Chvátal + +- Apply patch to fix build with new scipy: + * lmfit-scipy.patch + +------------------------------------------------------------------- +Fri Jan 18 10:19:27 UTC 2019 - Tomáš Chvátal + +- Update to 0.9.12: + * make exceptions explicit + * use inspect.getfullargspec for Python3 + * test-suite: use pytest features, improve coverage, fix mistakes + +------------------------------------------------------------------- +Thu Mar 22 04:46:08 UTC 2018 - toddrme2178@gmail.com + +- Initial version diff --git a/python-lmfit.spec b/python-lmfit.spec new file mode 100644 index 0000000..79966de --- /dev/null +++ b/python-lmfit.spec @@ -0,0 +1,123 @@ +# +# spec file for package python-lmfit +# +# Copyright (c) 2020 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/ +# + + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%define skip_python2 1 +Name: python-lmfit +Version: 1.0.1 +Release: 0 +Summary: Least-Squares Minimization with Bounds and Constraints +License: MIT AND BSD-3-Clause +URL: https://lmfit.github.io/lmfit-py/ +Source: https://files.pythonhosted.org/packages/source/l/lmfit/lmfit-%{version}.tar.gz +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-asteval >= 0.9.16 +Requires: python-numpy >= 1.16 +Requires: python-scipy >= 1.2 +Recommends: python-dill +Recommends: python-emcee +Recommends: python-matplotlib +Recommends: python-pandas +Recommends: python-uncertainties >= 3.0.1 +BuildArch: noarch +# SECTION test requirements +BuildRequires: %{python_module asteval >= 0.9.16} +BuildRequires: %{python_module numpy >= 1.16} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module scipy >= 1.2} +BuildRequires: %{python_module uncertainties >= 3.0.1} +# /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 + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +python3 -c "import sys, lmfit, numpy, scipy, asteval, uncertainties, six;print('Python: {}\n\nlmfit: {}, scipy: {}, numpy: {}, asteval: {}, uncertainties: {}, six: {}'.format(sys.version, lmfit.__version__, scipy.__version__, numpy.__version__, asteval.__version__, uncertainties.__version__, six.__version__))" + +cat << 'EOF' >> testexample.py +import numpy as np + +import lmfit +from lmfit.lineshapes import gaussian +from lmfit.models import PseudoVoigtModel + +x = np.linspace(0, 10, 201) +np.random.seed(0) +y = gaussian(x, 10.0, 6.15, 0.8) +y += gaussian(x, 8.0, 6.35, 1.1) +y += gaussian(x, 0.25, 6.00, 7.5) +y += np.random.normal(size=len(x), scale=0.5) + +# with NaN values in the input data +y[55] = y[91] = np.nan +mod = PseudoVoigtModel() +params = mod.make_params(amplitude=20, center=5.5, + sigma=1, fraction=0.25) +params['fraction'].vary = False + +# with propagate, should get no error, but bad results +result = mod.fit(y, params, x=x, nan_policy='propagate') +lmfit.report_fit(result) + +print(result.__dict__) +EOF + +cat testexample.py + +python3 testexample.py + + +# We don't care about speed, and test_itercb is architecture-specific +%pytest -k 'not speed' + +%files %{python_files} +%doc README.rst THANKS.txt +%license LICENSE +%{python_sitelib}/* + +%changelog