Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-iminuit for openSUSE:Factory checked in at 2021-12-09 19:45:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-iminuit (Old) and /work/SRC/openSUSE:Factory/.python-iminuit.new.2520 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-iminuit" Thu Dec 9 19:45:35 2021 rev:17 rq:937362 version:2.8.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-iminuit/python-iminuit.changes 2021-09-16 23:17:54.559999406 +0200 +++ /work/SRC/openSUSE:Factory/.python-iminuit.new.2520/python-iminuit.changes 2021-12-09 19:46:06.981147901 +0100 @@ -1,0 +2,12 @@ +Wed Dec 8 14:38:34 UTC 2021 - pgaj...@suse.com + +- version update to 2.8.4 + Fixes + * Pickling of util.Matrix resulted in incomplete state after unpickling, + which would cause an exception when you tried to print the matrix + Documentation + * New tutorial on fitting PDFs that depend on a conditional variable + * Fixed JAX tutorial, adapting to change in their interface + * Extended documentation of cost functions + +------------------------------------------------------------------- Old: ---- iminuit-2.8.3.tar.gz New: ---- iminuit-2.8.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-iminuit.spec ++++++ --- /var/tmp/diff_new_pack.FfT9Sm/_old 2021-12-09 19:46:07.865148326 +0100 +++ /var/tmp/diff_new_pack.FfT9Sm/_new 2021-12-09 19:46:07.869148328 +0100 @@ -22,7 +22,7 @@ %define skip_python36 1 %define modname iminuit Name: python-%{modname} -Version: 2.8.3 +Version: 2.8.4 Release: 0 Summary: Python bindings for MINUIT2 License: MIT ++++++ iminuit-2.8.3.tar.gz -> iminuit-2.8.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/PKG-INFO new/iminuit-2.8.4/PKG-INFO --- old/iminuit-2.8.3/PKG-INFO 2021-09-03 17:08:02.901465400 +0200 +++ new/iminuit-2.8.4/PKG-INFO 2021-10-11 11:28:35.619011900 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: iminuit -Version: 2.8.3 +Version: 2.8.4 Summary: Jupyter-friendly Python frontend for MINUIT2 in C++ Home-page: http://github.com/scikit-hep/iminuit Author: Piti Ongmongkolkul and the iminuit team @@ -30,9 +30,11 @@ .. image:: https://readthedocs.org/projects/iminuit/badge/?version=stable :target: https://iminuit.readthedocs.io/en/stable .. image:: https://img.shields.io/pypi/l/iminuit - :alt: License .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3949207.svg :target: https://doi.org/10.5281/zenodo.3949207 + .. image:: https://img.shields.io/badge/ascl-2108.024-blue.svg?colorB=262255 + :target: https://ascl.net/2108.024 + :alt: ascl:2108.024 *iminuit* is a Jupyter-friendly Python interface for the *Minuit2* C++ library maintained by CERN's ROOT team. @@ -44,10 +46,15 @@ The iminuit package comes with additional features: - - Included cost functions for binned and unbinned maximum-likelihood and (robust) - least-squares fits - - Support for SciPy minimisers - - Numba support (optional) + - Builtin cost functions for statistical fits + + - Binned and unbinned maximum-likelihood + - Non-linear regression with (optionally robust) weighted least-squares + - Gaussian penalty terms + - Cost functions can be combined by adding them: ``total_cost = cost_1 + cost_2`` + - Tools for numerical error propagation ``iminuit.util.propagate`` + - Support for SciPy minimisers as alternatives to Minuit's Migrad algorithm (optional) + - Support for Numba accelerated functions (optional) Checkout our large and comprehensive list of `tutorials`_ that take you all the way from beginner to power user. For help and how-to questions, please use the `discussions`_ on GitHub. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/README.rst new/iminuit-2.8.4/README.rst --- old/iminuit-2.8.3/README.rst 2021-09-03 17:07:34.000000000 +0200 +++ new/iminuit-2.8.4/README.rst 2021-10-11 11:28:10.000000000 +0200 @@ -18,9 +18,11 @@ .. image:: https://readthedocs.org/projects/iminuit/badge/?version=stable :target: https://iminuit.readthedocs.io/en/stable .. image:: https://img.shields.io/pypi/l/iminuit - :alt: License .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3949207.svg :target: https://doi.org/10.5281/zenodo.3949207 +.. image:: https://img.shields.io/badge/ascl-2108.024-blue.svg?colorB=262255 + :target: https://ascl.net/2108.024 + :alt: ascl:2108.024 *iminuit* is a Jupyter-friendly Python interface for the *Minuit2* C++ library maintained by CERN's ROOT team. @@ -32,10 +34,15 @@ The iminuit package comes with additional features: -- Included cost functions for binned and unbinned maximum-likelihood and (robust) - least-squares fits -- Support for SciPy minimisers -- Numba support (optional) +- Builtin cost functions for statistical fits + + - Binned and unbinned maximum-likelihood + - Non-linear regression with (optionally robust) weighted least-squares + - Gaussian penalty terms + - Cost functions can be combined by adding them: ``total_cost = cost_1 + cost_2`` +- Tools for numerical error propagation ``iminuit.util.propagate`` +- Support for SciPy minimisers as alternatives to Minuit's Migrad algorithm (optional) +- Support for Numba accelerated functions (optional) Checkout our large and comprehensive list of `tutorials`_ that take you all the way from beginner to power user. For help and how-to questions, please use the `discussions`_ on GitHub. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/setup.cfg new/iminuit-2.8.4/setup.cfg --- old/iminuit-2.8.3/setup.cfg 2021-09-03 17:08:02.905465400 +0200 +++ new/iminuit-2.8.4/setup.cfg 2021-10-11 11:28:35.619011900 +0200 @@ -70,6 +70,7 @@ sphinx_rtd_theme tabulate nbsphinx + boost_histogram doc = sphinx==4.1 sphinx-rtd-theme diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/src/iminuit/cost.py new/iminuit-2.8.4/src/iminuit/cost.py --- old/iminuit-2.8.3/src/iminuit/cost.py 2021-09-03 17:07:34.000000000 +0200 +++ new/iminuit-2.8.4/src/iminuit/cost.py 2021-10-11 11:28:10.000000000 +0200 @@ -1,10 +1,40 @@ """ -Standard cost functions to minimize. +Standard cost functions to minimize for statistical fits. -The cost functions defined here should be preferred over custom implementations. They -have been optimized with knowledge about implementation details of Minuit to give the -highest accucary and the most robust results. They are partially accelerated with numba, -if numba is available. +We provide these for convenience, so that you do not have to write your own for standard fits. +The cost functions optionally use Numba to accelerate some calculations, if Numba is +installed. + +What to use when +---------------- +- Fit a normalised probability density to data + - Data is not binned: UnbinnedNLL + - Data is binned: BinnedNLL, also supports histogram of weighted samples +- Fit a density to data, density is not normalised + - Data is not binned: ExtendedUnbinnedNLL + - Data is binned: ExtendedBinnedNLL, also supports histogram of weighted samples +- Fit of a function f(x) to (x, y, yerror) pairs with normal-distributed fluctuations + (x can be multi-dimensional) + - y values contain no outliers: LeastSquares + - y values contain outliers: LeastSquares with "soft_l1" loss function + +Combining cost functions +------------------------ +All cost functions can be added, which generates a new combined cost function. +Parameters with the same name are shared between component cost functions. Use this to +constrain one or several parameters with different data sets and using different +statistical models for each data set. Gaussian penalty terms can also be added to the +cost function to introduce external knowledge about a parameter. + +Notes +----- +The cost functions defined here have been optimized with knowledge about implementation +details of Minuit to give the highest accucary and the most robust results, so they +should perform well. If you have trouble with your own implementations, try these. + +The binned versions of the log-likelihood fits support weighted samples. For each bin +of the histogram, the sum of weights and the sum of squared weights is needed then, see +class documentation for details. """ from .util import describe, make_func_code, merge_signatures, PerformanceWarning diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/src/iminuit/util.py new/iminuit-2.8.4/src/iminuit/util.py --- old/iminuit-2.8.3/src/iminuit/util.py 2021-09-03 17:07:34.000000000 +0200 +++ new/iminuit-2.8.4/src/iminuit/util.py 2021-10-11 11:28:10.000000000 +0200 @@ -1,4 +1,9 @@ -"""Data classes and utilities used by :class:`iminuit.Minuit`.""" +""" +Data classes and utilities used by :class:`iminuit.Minuit`. + +You can look up the interface of data classes that iminuit uses here. Also of interest +for users are :func:`propagate` and :func:`make_with_signature`. +""" import inspect from collections import OrderedDict from argparse import Namespace @@ -340,6 +345,17 @@ else: p.text(str(self)) + # ndarray uses __reduce__ for pickling instead of __getstate__ + def __reduce__(self): + """Get representation for pickling and copying.""" + restore, args, state = super().__reduce__() + return restore, args, (state, self._var2pos) + + def __setstate__(self, state): + """Restore from pickled state.""" + state, self._var2pos = state + super().__setstate__(state) + class FMin: """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/src/iminuit/version.py new/iminuit-2.8.4/src/iminuit/version.py --- old/iminuit-2.8.3/src/iminuit/version.py 2021-09-03 17:07:34.000000000 +0200 +++ new/iminuit-2.8.4/src/iminuit/version.py 2021-10-11 11:28:10.000000000 +0200 @@ -7,7 +7,7 @@ # - Increase MAINTENANCE when fixing bugs without adding features # - During development, add suffix .devN with N >= 0 # - For release candidates, add suffix .rcN with N >= 0 -version = "2.8.3" +version = "2.8.4" # We list the corresponding ROOT version of the C++ Minuit2 library here root_version = "v6-25-01-1694-g187368db19" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/src/iminuit.egg-info/PKG-INFO new/iminuit-2.8.4/src/iminuit.egg-info/PKG-INFO --- old/iminuit-2.8.3/src/iminuit.egg-info/PKG-INFO 2021-09-03 17:08:02.000000000 +0200 +++ new/iminuit-2.8.4/src/iminuit.egg-info/PKG-INFO 2021-10-11 11:28:35.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: iminuit -Version: 2.8.3 +Version: 2.8.4 Summary: Jupyter-friendly Python frontend for MINUIT2 in C++ Home-page: http://github.com/scikit-hep/iminuit Author: Piti Ongmongkolkul and the iminuit team @@ -30,9 +30,11 @@ .. image:: https://readthedocs.org/projects/iminuit/badge/?version=stable :target: https://iminuit.readthedocs.io/en/stable .. image:: https://img.shields.io/pypi/l/iminuit - :alt: License .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3949207.svg :target: https://doi.org/10.5281/zenodo.3949207 + .. image:: https://img.shields.io/badge/ascl-2108.024-blue.svg?colorB=262255 + :target: https://ascl.net/2108.024 + :alt: ascl:2108.024 *iminuit* is a Jupyter-friendly Python interface for the *Minuit2* C++ library maintained by CERN's ROOT team. @@ -44,10 +46,15 @@ The iminuit package comes with additional features: - - Included cost functions for binned and unbinned maximum-likelihood and (robust) - least-squares fits - - Support for SciPy minimisers - - Numba support (optional) + - Builtin cost functions for statistical fits + + - Binned and unbinned maximum-likelihood + - Non-linear regression with (optionally robust) weighted least-squares + - Gaussian penalty terms + - Cost functions can be combined by adding them: ``total_cost = cost_1 + cost_2`` + - Tools for numerical error propagation ``iminuit.util.propagate`` + - Support for SciPy minimisers as alternatives to Minuit's Migrad algorithm (optional) + - Support for Numba accelerated functions (optional) Checkout our large and comprehensive list of `tutorials`_ that take you all the way from beginner to power user. For help and how-to questions, please use the `discussions`_ on GitHub. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/src/iminuit.egg-info/SOURCES.txt new/iminuit-2.8.4/src/iminuit.egg-info/SOURCES.txt --- old/iminuit-2.8.3/src/iminuit.egg-info/SOURCES.txt 2021-09-03 17:08:02.000000000 +0200 +++ new/iminuit-2.8.4/src/iminuit.egg-info/SOURCES.txt 2021-10-11 11:28:35.000000000 +0200 @@ -293,6 +293,7 @@ tests/test_experimental.py tests/test_fmin_bad.txt tests/test_functions.py +tests/test_issue.py tests/test_minimize.py tests/test_minuit.py tests/test_pdg_format.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/src/iminuit.egg-info/requires.txt new/iminuit-2.8.4/src/iminuit.egg-info/requires.txt --- old/iminuit-2.8.3/src/iminuit.egg-info/requires.txt 2021-09-03 17:08:02.000000000 +0200 +++ new/iminuit-2.8.4/src/iminuit.egg-info/requires.txt 2021-10-11 11:28:35.000000000 +0200 @@ -32,3 +32,4 @@ sphinx_rtd_theme tabulate nbsphinx +boost_histogram diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/tests/test_issue.py new/iminuit-2.8.4/tests/test_issue.py --- old/iminuit-2.8.3/tests/test_issue.py 1970-01-01 01:00:00.000000000 +0100 +++ new/iminuit-2.8.4/tests/test_issue.py 2021-10-11 11:28:10.000000000 +0200 @@ -0,0 +1,118 @@ +from iminuit import Minuit +from iminuit.util import IMinuitWarning +import pickle +import pytest +import numpy as np + + +def lsq(func): + func.errordef = Minuit.LEAST_SQUARES + return func + + +def test_issue_424(): + @lsq + def fcn(x, y, z): + return (x - 1) ** 2 + (y - 4) ** 2 / 2 + (z - 9) ** 2 / 3 + + m = Minuit(fcn, x=0.0, y=0.0, z=0.0) + m.migrad() + + m.fixed["x"] = True + m.errors["x"] = 2 + m.hesse() # this used to release x + assert m.fixed["x"] is True + assert m.errors["x"] == 2 + + +def test_issue_544(): + @lsq + def fcn(x, y): + return x ** 2 + y ** 2 + + m = Minuit(fcn, x=0, y=0) + m.fixed = True + with pytest.warns(IMinuitWarning): + m.hesse() # this used to cause a segfault + + +def test_issue_648(): + class F: + errordef = 1 + first = True + + def __call__(self, a, b): + if self.first: + assert a == 1.0 and b == 2.0 + self.first = False + return a ** 2 + b ** 2 + + m = Minuit(F(), a=1, b=2) + m.fixed["a"] = False # this used to change a to b + m.migrad() + + +def test_issue_643(): + @lsq + def fcn(x, y, z): + return (x - 2) ** 2 + (y - 3) ** 2 + (z - 4) ** 2 + + m = Minuit(fcn, x=2, y=3, z=4) + m.migrad() + + m2 = Minuit(fcn, x=m.values["x"], y=m.values["y"], z=m.values["z"]) + # used to call MnHesse when it was not needed and quickly exhaust call limit + for i in range(10): + m2.minos() + + m2.reset() + # used to exhaust call limit, because calls to MnHesse did not reset call count + for i in range(10): + m2.values = m.values + m2.minos() + + +def test_issue_669(): + @lsq + def fcn(x, y): + return x ** 2 + (y / 2) ** 2 + + m = Minuit(fcn, x=0, y=0) + + m.migrad() + + xy1 = m.mncontour(x="x", y="y", size=10) + xy2 = m.mncontour(x="y", y="x", size=10) # used to fail + + # needs better way to compare polygons + for x, y in xy1: + match = False + for (y2, x2) in xy2: + if abs(x - x2) < 1e-3 and abs(y - y2) < 1e-3: + match = True + break + assert match + + +@lsq +def fcn(par): + return np.sum(par ** 2) + + +def grad(par): + return 2 * par + + +def test_issue_687(): + + start = np.zeros(3) + m = Minuit(fcn, start) + + m.migrad() + s_m = str(m) + + s = pickle.dumps(m) + m2 = pickle.loads(s) + + s_m2 = str(m2) # this used to fail + assert s_m == s_m2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/tests/test_minuit.py new/iminuit-2.8.4/tests/test_minuit.py --- old/iminuit-2.8.3/tests/test_minuit.py 2021-09-03 17:07:34.000000000 +0200 +++ new/iminuit-2.8.4/tests/test_minuit.py 2021-10-11 11:28:10.000000000 +0200 @@ -1195,21 +1195,6 @@ assert str(expected) in str(excinfo.value) -def test_issue_424(): - def lsq(x, y, z): - return (x - 1) ** 2 + (y - 4) ** 2 / 2 + (z - 9) ** 2 / 3 - - m = Minuit(lsq, x=0.0, y=0.0, z=0.0) - m.errordef = 1 - m.migrad() - - m.fixed["x"] = True - m.errors["x"] = 2 - m.hesse() - assert m.fixed["x"] is True - assert m.errors["x"] == 2 - - @pytest.mark.parametrize("sign", (-1, 1)) def test_parameter_at_limit(sign): m = Minuit(lambda x: (x - sign * 1.2) ** 2, x=0) @@ -1362,13 +1347,6 @@ m.tol = -1 -def test_issue_544(): - m = Minuit(func0, x=0, y=0) - m.fixed = True - with pytest.warns(IMinuitWarning): - m.hesse() # this used to cause a segfault - - def test_cfunc(): nb = pytest.importorskip("numba") @@ -1516,64 +1494,9 @@ assert_equal(m.ndof, np.nan) -def test_issue_648(): - class F: - errordef = 1 - first = True - - def __call__(self, a, b): - if self.first: - assert a == 1.0 and b == 2.0 - self.first = False - return a ** 2 + b ** 2 - - m = Minuit(F(), a=1, b=2) - m.fixed["a"] = False # this used to change a to b - m.migrad() - - def test_call_limit_reached_in_hesse(): m = Minuit(lambda x: ((x - 1.2) ** 4).sum(), np.ones(10) * 10) m.errordef = 1 m.migrad(ncall=200) assert m.fmin.has_reached_call_limit assert m.fmin.nfcn < 205 - - -def test_issue_643(): - def fcn(x, y, z): - return (x - 2) ** 2 + (y - 3) ** 2 + (z - 4) ** 2 - - fcn.errordef = Minuit.LEAST_SQUARES - - m = Minuit(fcn, x=2, y=3, z=4) - m.migrad() - - m2 = Minuit(fcn, x=m.values["x"], y=m.values["y"], z=m.values["z"]) - # used to call MnHesse when it was not needed and quickly exhaust call limit - for i in range(10): - m2.minos() - - m2.reset() - # used to exhaust call limit, because calls to MnHesse did not reset call count - for i in range(10): - m2.values = m.values - m2.minos() - - -def test_issue_669(): - m = Minuit(func0, x=0, y=0) - - m.migrad() - - xy1 = m.mncontour(x="x", y="y", size=10) - xy2 = m.mncontour(x="y", y="x", size=10) # used to fail - - # needs better way to compare polygons - for x, y in xy1: - match = False - for (y2, x2) in xy2: - if abs(x - x2) < 1e-3 and abs(y - y2) < 1e-3: - match = True - break - assert match diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/iminuit-2.8.3/tests/test_util.py new/iminuit-2.8.4/tests/test_util.py --- old/iminuit-2.8.3/tests/test_util.py 2021-09-03 17:07:34.000000000 +0200 +++ new/iminuit-2.8.4/tests/test_util.py 2021-10-11 11:28:10.000000000 +0200 @@ -4,6 +4,7 @@ from numpy.testing import assert_equal, assert_allclose import numpy as np from iminuit._core import MnUserParameterState +import pickle def test_ndim(): @@ -112,6 +113,12 @@ with pytest.raises(TypeError): util.Matrix(1) + m2 = pickle.loads(pickle.dumps(m)) + assert type(m2) is util.Matrix + + assert_equal(m2, m) + assert m2._var2pos == m._var2pos + def test_Param(): values = 3, "foo", 1.2, 3.4, None, False, False, 42, None