7#include "MantidTypes/SpectrumDefinition.h"
9#include <boost/python/class.hpp>
10#include <boost/python/tuple.hpp>
12using Mantid::SpectrumDefinition;
16boost::python::tuple
toTuple(
const SpectrumDefinition &self,
const size_t index) {
17 const std::pair<size_t, size_t> pair = self.operator[](
index);
18 return make_tuple(pair.first, pair.second);
22 class_<SpectrumDefinition>(
"SpectrumDefinition", no_init)
24 .def(
"__getitem__", &
toTuple, (arg(
"self"), arg(
"index")),
25 "Returns the pair of detector index and time index at given index "
26 "of spectrum definition.")
28 .def(
"__len__", &SpectrumDefinition::size, arg(
"self"),
29 "Returns the size of the SpectrumDefinition i.e. the number of "
30 "detectors for the spectrum.")
32 .def(
"size", &SpectrumDefinition::size, arg(
"self"),
33 "Returns the size of the SpectrumDefinition i.e. the number of "
34 "detectors for the spectrum.")
36 .def(
"add", &SpectrumDefinition::add, (arg(
"self"), arg(
"detectorIndex"), arg(
"timeIndex")),
37 "Adds a pair of detector index and time index to the spectrum "
40 .def(
"equals", &SpectrumDefinition::operator==, (arg(
"self"), arg(
"other")),
"Compare spectrum definitions.");
std::map< DeltaEMode::Type, std::string > index
void export_SpectrumDefinition()
boost::python::tuple toTuple(const SpectrumDefinition &self, const size_t index)