Skip to content

Commit

Permalink
minor tweaks to prepare release
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Oct 11, 2021
1 parent b739be1 commit 23be056
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 14 deletions.
13 changes: 13 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
-------------------------

Expand Down
22 changes: 11 additions & 11 deletions src/iminuit/cost.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/iminuit/util.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/iminuit/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 4 additions & 1 deletion tests/test_issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 23be056

Please sign in to comment.