Show HN: Iminuit v2.0 Released

by olq_ploon 12/8/2020, 10:31 AMwith 2 comments

by olq_ploon 12/8/2020, 10:39 AM

Hi, I present the v2.0 overhaul of iminuit, the Jupyter-friendly Python interface for CERN's Minuit2 C++ library.

iminuit is a minimizer to find a minimum of a mathematical (Python) function. It is used by people who fit complicated statistical models to data. There are many other minimizers out there (like those in scipy), but iminuit can also compute uncertainty estimates for the fitted values, which almost no other package can do. If that is not of interest to you, you can stop reading here :).

iminuit has been around for a long time and is popular in the astroparticle physics community, but its roots are in the high energy physics community, where almost every publication uses Minuit in some way.

Most of CERN's software is bundled in ROOT, a large framework that can do all kinds of things. Some people, however, prefer small packages that do specific things, and for those iminuit was written.

You can easily pip install iminuit and try it on one of the tutorials, everything is heavily documented. Starting with iminuit now is the best time, because the interface has been really cleaned up in v2.0.

by olq_ploon 12/8/2020, 10:47 AM

Apart from the visible changes to the user interface, I completely swapped out the foundation. iminuit consists - at its core - of Python bindings to the Minuit2 C++ library.

We used to generate those bindings with Cython, but Cython is very bad at generating bindings for C++. It does not support all modern features and imposes restrictions on what you can wrap. It is also an external code generator that you have to install.

Cython was a real problem, so we switched to the excellent pybind11 library. It is C++ header-only library. Generating Python bindings with that is a breeze and it supports all possible C++ constructs. We lost at lot of weight and awkward complexity by switching out the foundation.