Mantid
Loading...
Searching...
No Matches
ProgressBase.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
8#include <boost/python/class.hpp>
9
11using namespace boost::python;
12
14 class_<ProgressBase, boost::noncopyable>("ProgressBase", no_init)
15 .def("report", (void (ProgressBase::*)()) & ProgressBase::report, arg("self"),
16 "Increment the progress by 1 and report with no message")
17
18 .def("report", (void (ProgressBase::*)(const std::string &)) & ProgressBase::report, (arg("self"), arg("msg")),
19 "Increment the progress by 1 and report along with "
20 "the given message")
21
22 .def("report", (void (ProgressBase::*)(int64_t, const std::string &)) & ProgressBase::report,
23 (arg("self"), arg("i"), arg("msg")),
24 "Set the progress to given amount and "
25 "report along with the given message")
26
27 .def("reportIncrement", (void (ProgressBase::*)(size_t, const std::string &)) & ProgressBase::reportIncrement,
28 (arg("self"), arg("i"), arg("msg")),
29 "Increment the progress by given amount and "
30 "report along with the given message")
31
32 .def("setNumSteps", &ProgressBase::setNumSteps, (arg("self"), arg("nsteps")),
33 "Sets a new number of steps for the current progress range")
34
35 .def("resetNumSteps", &ProgressBase::resetNumSteps, (arg("self"), arg("nsteps"), arg("start"), arg("end")),
36 "Resets the number of steps & progress range to the given values")
37
38 .def("setNotifyStep", &ProgressBase::setNotifyStep, (arg("self"), arg("notifyStep")),
39 "Set how often the notifications are actually reported")
40
41 .def("getEstimatedTime", &ProgressBase::getEstimatedTime, arg("self"),
42 "Returns an estimate of the time remaining. May not be to accurate "
43 "if the reporting is lumpy.");
44}
void export_ProgressBase()
void resetNumSteps(int64_t nsteps, double start, double end)
Change the number of steps between start/end.
void reportIncrement(int inc, const std::string &msg="")
Sends the progress notification and increment the loop counter by more than one.
double getEstimatedTime() const
Returns the estimated number of seconds until the algorithm completes.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
Definition: ProgressBase.h:51
void setNumSteps(int64_t nsteps)
Change the number of steps between start/end.
void setNotifyStep(double notifyStepPct)
Override the frequency at which notifications are sent out.