15 # pragma warning(disable:4231)
18 # pragma warning(disable:4251)
21 # pragma warning(disable:4275)
24 # pragma warning(disable:4800)
28 #include <boost/python.hpp>
33 using namespace boost::python;
41 class_ < NTuple, bases < DataSource > >
43 "A derived class of DataSource that stores its tabular data vectors of\n"
44 "double precision numbers in C++. An NTuple object can be created in\n"
45 "a number of ways including reading from a file using the\n"
48 (
"NTuple ( None ) -> NTuple\n"
49 "NTuple ( value ) -> NTuple\n"
50 "NTuple ( sequence ) -> NTuple\n"
51 "NTuple ( NTuple ) -> NTuple\n"
53 "The form with no arguments creates an empty NTuple with no rows\n"
54 "or columns. The form with one value argument creates an empty\n"
55 "NTuple with `value' number of columns. The form with a sequence\n"
56 "argument creates an empty NTuple with the number of columns equal\n"
57 "to size of the sequence. The sequence should contain string which\n"
58 "are used as the column labels. The last form form creates an\n"
59 "NTuple\n whose contents is a copy of an existing one." ) )
61 .def ( init < unsigned int > ( ) )
63 .def ( init <
const std::vector < std::string > & > ( ) )
65 .def ( init < const NTuple & > () )
67 .def (
"setLabels", &NTuple::setLabels,
68 "setLabels ( sequence ) -> None\n"
70 "Sets the labels of the columns from the list of strings. If the\n"
71 "NTuple is empty, then also sets the number of columns to be the\n"
72 "size of the list. If the number of columns has already been\n"
73 "set, the the size of the list should be the same, otherwise\n"
74 "a RuntimeError exception is thrown." )
76 .def (
"getLabel", &NTuple::getLabelAt,
77 return_value_policy < copy_const_reference > (),
78 "getLabel ( index ) -> string\n"
80 "Returns the label at column index." )
82 .def (
"getRow", &NTuple::getRow,
83 return_value_policy < copy_const_reference> (),
84 "getRow ( index ) -> list\n"
86 "Returns the index row as list floats." )
88 .def (
"setIntervalCount", &NTuple::setIntervalCount,
89 "setIntervalCount ( count ) -> None\n"
91 "Sets the interval count between updates to the observers." )
93 .def (
"setIntervalEnabled", &NTuple::setIntervalEnabled,
94 "setIntervalEnable ( Boolean ) -> None\n"
96 "Sets the interval counting on or off" )
104 class_ < PyNTuple, bases < NTuple > >
106 "A derived class of DataSource that stores its tabular data vectors of\n"
107 "double precision numbers in C++. An NTuple object can be created in\n"
108 "a number of ways including reading from a file using the\n"
111 (
"NTuple ( None ) -> NTuple\n"
112 "NTuple ( value ) -> NTuple\n"
113 "NTuple ( sequence ) -> NTuple\n"
114 "NTuple ( NTuple ) -> NTuple\n"
116 "The form with no arguments creates an empty NTuple with no rows\n"
117 "or columns. The form with one value argument creates an empty\n"
118 "NTuple with `value' number of columns. The form with a sequence\n"
119 "argument creates an empty NTuple with the number of columns equal\n"
120 "to size of the sequence. The sequence should contain string which\n"
121 "are used as the column labels. The last form form creates an\n"
122 "NTuple\n whose contents is a copy of an existing one." ) )
124 .def ( init < unsigned int > ( ) )
126 .def ( init <
const std::vector < std::string > & > ( ) )
128 .def ( init < const PyNTuple & > () )
130 .def (
"setTitle", &PyNTuple::setTitle,
131 "setTitle ( string ) -> None\n"
133 "Sets the title of the ntuple. The title by default appears at\n"
134 "the top of a Display." )
137 &PyNTuple::addColumn,
138 "addColumn ( label, sequence ) -> index\n"
140 "Adds a new column with label." )
142 .def (
"append", &PyNTuple::append,
143 "append ( DataSource ) -> None\n"
145 "Appends the contents of the DataSource to the NTuple." )
147 .def (
"replaceColumn",
150 const std::vector < double > & ) )
151 &PyNTuple::replaceColumn,
152 "replaceColumn ( index, sequence ) -> None\n"
154 "Replaces the indexed column." )
156 .def (
"replaceColumn",
158 (
const std::string &,
const std::vector < double > & ) )
159 &PyNTuple::replaceColumn,
160 "replaceColumn ( label, sequence ) -> None\n"
162 "Replaces the labeled column." )
166 "addRow ( sequence ) -> None\n"
168 "Append a row at the end." )
174 "Clears the data elements of the DataSource. That is, remove\n"
175 "all the rows while keeping the column labels." )