[go: up one dir, main page]

File: print.cpp

package info (click to toggle)
iminuit 2.30.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,660 kB
  • sloc: cpp: 14,591; python: 11,177; makefile: 11; sh: 5
file content (26 lines) | stat: -rw-r--r-- 804 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "pybind11.hpp"
#include <Minuit2/MnPrint.h>

namespace py = pybind11;
using namespace ROOT::Minuit2;
using cstr = const char*;
using namespace pybind11::literals;

void bind_print(py::module m) {
  py::class_<MnPrint>(m, "MnPrint")

      .def(py::init<cstr, int>(), "prefix"_a, "level"_a)
      .def("error", &MnPrint::Error<cstr>)
      .def("warn", &MnPrint::Warn<cstr>)
      .def("info", &MnPrint::Info<cstr>)
      .def("debug", &MnPrint::Debug<cstr>)
      .def_property_static(
          "global_level", [](py::object) { return MnPrint::GlobalLevel(); },
          [](py::object, int x) { MnPrint::SetGlobalLevel(x); })

      .def("show_prefix_stack", &MnPrint::ShowPrefixStack)
      .def("add_filter", &MnPrint::AddFilter)
      .def("clear_filter", &MnPrint::ClearFilter)

      ;
}