Mantid
Loading...
Searching...
No Matches
IEventWorkspace.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 +
11
12#include <boost/python/class.hpp>
13#include <boost/python/object.hpp>
14
15using namespace Mantid::API;
17using namespace boost::python;
18
20
21namespace {
27IEventList &deprecatedGetEventList(IEventWorkspace &self, const size_t index) {
28 PyErr_Warn(PyExc_DeprecationWarning, "'getEventList' is deprecated, use 'getSpectrum' instead.");
29 return self.getSpectrum(index);
30}
31} // namespace
32
37 class_<IEventWorkspace, bases<Mantid::API::MatrixWorkspace>, boost::noncopyable>("IEventWorkspace", no_init)
38 .def("getNumberEvents", &IEventWorkspace::getNumberEvents, args("self"),
39 "Returns the number of events in the :class:`~mantid.api.Workspace`")
40 .def("getTofMin", &IEventWorkspace::getTofMin, args("self"),
41 "Returns the minimum TOF value (in microseconds) held by the "
42 ":class:`~mantid.api.Workspace`")
43 .def("getTofMax", &IEventWorkspace::getTofMax, args("self"),
44 "Returns the maximum TOF value (in microseconds) held by the "
45 ":class:`~mantid.api.Workspace`")
46 .def("getPulseTimeMin", &IEventWorkspace::getPulseTimeMin, args("self"),
47 "Returns the minimum pulse time held by the "
48 ":class:`~mantid.api.Workspace`")
49 .def("getPulseTimeMax", &IEventWorkspace::getPulseTimeMax, args("self"),
50 "Returns the maximum pulse time held by the "
51 ":class:`~mantid.api.Workspace`")
52 .def("getEventList", &deprecatedGetEventList, return_internal_reference<>(), args("self", "workspace_index"),
53 "Return the :class:`~mantid.api.IEventList` managing the events at "
54 "the given :class:`~mantid.api.Workspace` "
55 "index")
56 .def("clearMRU", &IEventWorkspace::clearMRU, args("self"), "Clear the most-recently-used lists");
57
59}
#define GET_POINTER_SPECIALIZATION(TYPE)
Definition: GetPointer.h:17
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
void export_IEventWorkspace()
Python exports of the Mantid::API::IEventWorkspace class.
IEventList : Interface to Mantid::DataObjects::EventList class, used to expose to PythonAPI.
Definition: IEventList.h:26
This class provides an interface to an EventWorkspace.
virtual Mantid::Types::Core::DateAndTime getPulseTimeMax() const =0
virtual double getTofMin() const =0
virtual Mantid::Types::Core::DateAndTime getPulseTimeMin() const =0
virtual double getTofMax() const =0
virtual void clearMRU() const =0
IEventList & getSpectrum(const size_t index) override=0
Return the underlying ISpectrum ptr at the given workspace index.
virtual std::size_t getNumberEvents() const =0
Encapsulates the registration required for an interface type T that sits on top of a Kernel::DataItem...