diff --git a/doc/changelog.rst b/doc/changelog.rst index 25ac5a604..0f4ce46b0 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -5,6 +5,19 @@ Changelog ========= +2.8.4 (October 11, 2021) +------------------------ +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 + 2.8.3 (September 3, 2021) ------------------------- diff --git a/src/iminuit/cost.py b/src/iminuit/cost.py index 5db351cc2..3845d3fda 100644 --- a/src/iminuit/cost.py +++ b/src/iminuit/cost.py @@ -1,21 +1,25 @@ """ Standard cost functions to minimize for statistical fits. +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 + - 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 + - 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 -Cost functions are addable --------------------------- +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 @@ -24,10 +28,9 @@ Notes ----- -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. +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 @@ -852,9 +855,6 @@ def _call(self, args): return np.einsum("i,ij,j", delta, self._covinv, delta) -GaussianPenalty = NormalConstraint - - def _norm(value): value = np.atleast_1d(value) dtype = value.dtype diff --git a/src/iminuit/util.py b/src/iminuit/util.py index cec30f37c..d2fa7d8b7 100644 --- a/src/iminuit/util.py +++ b/src/iminuit/util.py @@ -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 diff --git a/src/iminuit/version.py b/src/iminuit/version.py index f3ef59ea9..04b9ca42b 100644 --- a/src/iminuit/version.py +++ b/src/iminuit/version.py @@ -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 --git a/tests/test_issue.py b/tests/test_issue.py index c540ebaf6..d76de72b5 100644 --- a/tests/test_issue.py +++ b/tests/test_issue.py @@ -109,7 +109,10 @@ def test_issue_687(): m = Minuit(fcn, start) m.migrad() + s_m = str(m) s = pickle.dumps(m) m2 = pickle.loads(s) - print(m2) # this used to fail + + s_m2 = str(m2) # this used to fail + assert s_m == s_m2