Commit e98b7afe authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[python][status] register new functions

parent f4294ce9
......@@ -20,6 +20,7 @@
#define FRACKIT_PYTHON_SAMPLING_STATUS_HH
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <frackit/common/id.hh>
#include <frackit/sampling/status.hh>
......@@ -54,21 +55,38 @@ void registerSamplingStatus(py::module& module)
&SamplingStatus::reset,
"Reset everything");
cls.def("increaseRejectedCounter",
&SamplingStatus::increaseRejectedCounter,
py::overload_cast<>(&SamplingStatus::increaseRejectedCounter),
"Register that a sample has been rejected");
cls.def("increaseRejectedCounter",
py::overload_cast<const std::string&>(&SamplingStatus::increaseRejectedCounter),
"Register that a sample has been rejected passing a specific rejection label");
cls.def("getCount",
py::overload_cast<>(&SamplingStatus::getCount),
py::overload_cast<>(&SamplingStatus::getCount, py::const_),
"Returns the overall number of entities");
cls.def("getCount",
py::overload_cast<const Id&>(&SamplingStatus::getCount),
py::overload_cast<const Id&>(&SamplingStatus::getCount, py::const_),
"Returns the number of entities for the given id");
cls.def("getRejectedCount",
py::overload_cast<>(&SamplingStatus::getRejectedCount, py::const_),
"Returns the overall number of rejected entities");
cls.def("getRejectedCount",
py::overload_cast<const std::string&>(&SamplingStatus::getRejectedCount, py::const_),
"Returns the number of rejected entities for the given rejection label");
cls.def("getRejectionData",
&SamplingStatus::getRejectionData,
"Returns the registered rejection event data");
using namespace py::literals;
cls.def("print",
&SamplingStatus::print,
"forceHeaderPrint"_a=false,
"Print the current status");
cls.def("printRejectionData",
&SamplingStatus::printRejectionData,
"Print information on registered rejection events");
}
} // end namespace Frackit::Python
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment