provide python interpreter for mussa qui via a seperate thread
[mussa.git] / py / nway_paths.cpp
1 #include <boost/python.hpp>
2 namespace py = boost::python;
3
4 #include "alg/nway_paths.hpp"
5
6 void export_nway_paths()
7 {
8   /*py::class_<NwayPaths::ConservedPaths>("ConservedPaths")
9     .def("__len__", &NwayPaths::ConservedPaths::size, "return length of paths")
10     .def("__contains__", &std_item<NwayPaths::ConservedPaths>::in)
11     .def("__iter__", py::iterator<NwayPaths::ConservedPaths>())
12     .def("clear", &NwayPaths::ConservedPaths::clear, "remove all the paths")
13     .def("append", &std_item<NwayPaths::ConservedPaths>::add,
14         py::with_custodian_and_ward<1,2>()) // to let container keep value
15     .def("__getitem__", &std_item<NwayPaths::ConservedPaths>::get,
16         py::return_value_policy<py::copy_non_const_reference>())
17     .def("__setitem__", &std_item<NwayPaths::ConservedPaths>::set,
18         py::with_custodian_and_ward<1,2>()) // to let container keep value
19     .def("__delitem__", &std_item<NwayPaths::ConservedPaths>::del)
20   ;*/
21  
22    py::class_<NwayPaths>("NwayPaths")
23     .def("__len__", &NwayPaths::sequence_count)
24     .def("clear", &NwayPaths::clear, "remove all paths")
25     .add_property("threshold", &NwayPaths::get_threshold, "Get hard threshold")
26     .add_property("soft_threshold", &NwayPaths::get_soft_threshold, &NwayPaths::set_soft_threshold)
27     .add_property("window_size", &NwayPaths::get_window)
28     .add_property("pathz", py::range(&NwayPaths::pbegin, &NwayPaths::pend))
29     .add_property("refinedPathz", py::range(&NwayPaths::rpbegin, &NwayPaths::rpend))
30    ;
31 }
32