From 3ead3c16987ddc199768465a65e4f1316d02ad0861248e86b1d5b285ac1d03c6 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 30 Dec 2021 12:39:26 +0000 Subject: [PATCH] Accepting request 942992 from home:bnavigator:branches:devel:languages:python:numeric MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update to v1.0.3 **Potentially breaking change:** * argument ``x`` is now required for the ``guess`` method of Models (Issue #747; PR #748) To get reasonable estimates for starting values one should always supply both ``x`` and ``y`` values; in some cases it would work when only providing ``data`` (i.e., y-values). With the change above, ``x`` is now required in the ``guess`` method call, so scripts might need to be updated to explicitly supply ``x``. **Bug fixes/enhancements:** * do not overwrite user-specified figure titles in Model.plot() functions and allow setting with ``title`` keyword argument (PR #711) * preserve Parameters subclass in deepcopy (@jenshnielsen; PR #719) * coerce ``data`` and ``indepdent_vars`` to NumPy array with ``dtype=float64`` or ``dtype=complex128`` where applicable (Issues #723 and #728) * fix collision between parameter names in built-in models and user-specified parameters (Issue #710 and PR #732) * correct error message in PolynomialModel (@kremeyer; PR #737) * improved handling of altered JSON data (Issue #739; PR #740, reported by Matthew Giammar) * map ``max_nfev`` to ``maxiter`` when using ``differential_evolution`` (PR #749, reported by Olivier B.) * correct use of noise versus experimental uncertainty in the documentation (PR #751, reported by Andrés Zelcer) * specify return type of ``eval`` method more precisely and allow for plotting of (Complex)ConstantModel by coercing their OBS-URL: https://build.opensuse.org/request/show/942992 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-lmfit?expand=0&rev=6 --- lmfit-1.0.2.tar.gz | 3 -- lmfit-1.0.3.tar.gz | 3 ++ python-lmfit.changes | 66 ++++++++++++++++++++++++++++++++++++++++++++ python-lmfit.spec | 37 +++++++++++++++---------- 4 files changed, 92 insertions(+), 17 deletions(-) delete mode 100644 lmfit-1.0.2.tar.gz create mode 100644 lmfit-1.0.3.tar.gz diff --git a/lmfit-1.0.2.tar.gz b/lmfit-1.0.2.tar.gz deleted file mode 100644 index d5e1bf3..0000000 --- a/lmfit-1.0.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:67090ce56685cf7f92bd7358a1e7d4ad862b3758988109ec440e9825e5184b45 -size 306039 diff --git a/lmfit-1.0.3.tar.gz b/lmfit-1.0.3.tar.gz new file mode 100644 index 0000000..08e90a8 --- /dev/null +++ b/lmfit-1.0.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d067c3ea501f035af5d3c079e6e6e35dc3cc1ac7d439429a425b0aeb5a7858a2 +size 292475 diff --git a/python-lmfit.changes b/python-lmfit.changes index 373da2b..af90758 100644 --- a/python-lmfit.changes +++ b/python-lmfit.changes @@ -1,3 +1,69 @@ +------------------------------------------------------------------- +Tue Dec 28 19:11:00 UTC 2021 - Ben Greiner + +- Update to v1.0.3 + **Potentially breaking change:** + * argument ``x`` is now required for the ``guess`` method of + Models (Issue #747; PR #748) + + To get reasonable estimates for starting values one should + always supply both ``x`` and ``y`` values; in some cases it + would work when only providing ``data`` (i.e., y-values). With + the change above, ``x`` is now required in the ``guess`` method + call, so scripts might need to be updated to explicitly supply + ``x``. + **Bug fixes/enhancements:** + * do not overwrite user-specified figure titles in Model.plot() + functions and allow setting with ``title`` keyword argument (PR + #711) + * preserve Parameters subclass in deepcopy (@jenshnielsen; PR + #719) + * coerce ``data`` and ``indepdent_vars`` to NumPy array with + ``dtype=float64`` or ``dtype=complex128`` where applicable + (Issues #723 and #728) + * fix collision between parameter names in built-in models and + user-specified parameters (Issue #710 and PR #732) + * correct error message in PolynomialModel (@kremeyer; PR #737) + * improved handling of altered JSON data (Issue #739; PR #740, + reported by Matthew Giammar) + * map ``max_nfev`` to ``maxiter`` when using + ``differential_evolution`` (PR #749, reported by Olivier B.) + * correct use of noise versus experimental uncertainty in the + documentation (PR #751, reported by Andrés Zelcer) + * specify return type of ``eval`` method more precisely and allow + for plotting of (Complex)ConstantModel by coercing their + ``float``, ``int``, or ``complex`` return value to a + ``numpy.ndarray`` (Issue #684 and PR #754) + * fix ``dho`` (Damped Harmonic Oscillator) lineshape (PR #755; + @rayosborn) + * reset ``Minimizer._abort`` to ``False`` before starting a new + fit (Issue #756 and PR #757; @azelcer) + * fix typo in ``guess_from_peak2d`` (@ivan-usovl; PR #758) + **Various:** + * update asteval dependency to >= 0.9.22 to avoid + DeprecationWarnings from NumPy v1.20.0 (PR #707) + * remove incorrectly spelled ``DonaichModel`` and ``donaich`` + lineshape, deprecated in version 1.0.1 (PR #707) + * remove occurrences of OrderedDict throughout the code; dict is + order-preserving since Python 3.6 (PR #713) + * update the contributing instructions (PR #718; @martin-majlis) + * (again) defer import of matplotlib to when it is needed + (@zobristnicholas; PR #721) + * fix description of ``name`` argument in ``Parameters.add`` + (@kristianmeyerr; PR #725) + * update dependencies, make sure a functional development + environment is installed on Windows (Issue #712) + * use ``setuptools_scm`` for version info instead of + ``versioneer`` (PR #729) + * transition to using ``f-strings`` (PR #730) + * mark ``test_manypeaks_speed.py`` as flaky to avoid intermittent + test failures (repeat up to 5 times; PR #745) + * update scipy dependency to >= 1.14.0 (PR #751) + * improvement to output of examples in sphinx-gallery and use + higher resolution figures (PR #753) + * remove deprecated functions ``lmfit.printfuncs.report_errors`` + and ``asteval`` argument in ``Parameters`` class (PR #759) + ------------------------------------------------------------------- Wed Feb 17 11:46:57 UTC 2021 - Ben Greiner diff --git a/python-lmfit.spec b/python-lmfit.spec index ca494b6..978e268 100644 --- a/python-lmfit.spec +++ b/python-lmfit.spec @@ -16,20 +16,21 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?!python_module:%define python_module() python3-%{**}} %define skip_python2 1 %define skip_python36 1 Name: python-lmfit -Version: 1.0.2 +Version: 1.0.3 Release: 0 Summary: Least-Squares Minimization with Bounds and Constraints -License: MIT AND BSD-3-Clause +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 setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-asteval >= 0.9.21 +Requires: python-asteval >= 0.9.22 Requires: python-numpy >= 1.18 Requires: python-scipy >= 1.3 Recommends: python-dill @@ -39,10 +40,10 @@ Recommends: python-pandas Recommends: python-uncertainties >= 3.0.1 BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module asteval >= 0.9.21} +BuildRequires: %{python_module asteval >= 0.9.22} BuildRequires: %{python_module numpy >= 1.18} BuildRequires: %{python_module pytest} -BuildRequires: %{python_module scipy >= 1.3} +BuildRequires: %{python_module scipy >= 1.4} BuildRequires: %{python_module uncertainties >= 3.0.1} # /SECTION %python_subpackages @@ -69,6 +70,8 @@ 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 %python_build @@ -78,16 +81,16 @@ sed -i -e '/^#!\//, 1d' lmfit/jsonutils.py %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%{python_exec -c "import sys, lmfit, numpy, scipy, asteval, uncertainties, six; +%{python_exec -c "import sys, lmfit, numpy, scipy, asteval, uncertainties; print('Python: {}\n\n' -'lmfit: {}, scipy: {}, numpy: {}, asteval: {}, uncertainties: {}, six: {}'.format( +'lmfit: {}, scipy: {}, numpy: {}, asteval: {}, uncertainties: {}'.format( sys.version, lmfit.__version__, scipy.__version__, numpy.__version__, asteval.__version__, - uncertainties.__version__, - six.__version__))"} + uncertainties.__version__ +))"} cat << 'EOF' >> testexample.py import numpy as np @@ -121,10 +124,16 @@ cat testexample.py %python_exec testexample.py -# We don't care about speed, and test_itercb is architecture-specific -# test_model_nan_policy - fails on non x86_64 -# test_shgo_scipy_vs_lmfit_2 - fails on non x86_64 -%pytest -k 'not speed and not (test_model_nan_policy or test_shgo_scipy_vs_lmfit_2)' +# We don't care about speed +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 THANKS.txt