11#include " py_properties.hh"
22#include " py_kernel.hh"
3+ #include " py_helpers.hh"
34
45#include " properties/Accent.hh"
56#include " properties/AntiCommuting.hh"
@@ -223,7 +224,7 @@ namespace cadabra {
223224// using cpp_type = typename base_type::cpp_type;
224225 using py_type = typename base_type::py_type;
225226
226- return py_type (m, name.c_str (), py::multiple_inheritance ())
227+ return py_type (m, name.c_str (), py::multiple_inheritance (), read_manual ( " properties " , name. c_str ()). c_str () )
227228 .def_static (" get" , [](Ex_ptr ex, const std::string& label, bool ipr) { return base_type::get_from_kernel (ex->begin (), label, ipr); }, py::arg (" ex" ), py::arg (" label" ) = " " , py::arg (" ignore_parent_rel" ) = false )
228229 .def_static (" get" , [](ExNode node, const std::string& label, bool ipr) { return base_type::get_from_kernel (node.it , label, ipr); }, py::arg (" exnode" ), py::arg (" label" ) = " " , py::arg (" ignore_parent_rel" ) = false )
229230 .def (" attach" , &BoundPropT::attach)
@@ -239,14 +240,16 @@ namespace cadabra {
239240 using cpp_type = typename base_type::cpp_type;
240241 using py_type = typename base_type::py_type;
241242
242- return py_type (m, std::make_shared<cpp_type>()->name ().c_str (), py::multiple_inheritance ())
243+ return py_type (m, std::make_shared<cpp_type>()->name ().c_str (), py::multiple_inheritance (), read_manual ( " properties " , std::make_shared<cpp_type>()-> name (). c_str ()). c_str () )
243244 .def (py::init<Ex_ptr, Ex_ptr>(), py::arg (" ex" ), py::arg (" param" )=Ex{})
245+
244246 .def_static (" get" , [](Ex_ptr ex, const std::string& label, bool ipr) { return base_type::get_from_kernel (ex->begin (), label, ipr); }, py::arg (" ex" ), py::arg (" label" ) = " " , py::arg (" ignore_parent_rel" ) = false )
245247 .def_static (" get" , [](ExNode node, const std::string& label, bool ipr) { return base_type::get_from_kernel (node.it , label, ipr); }, py::arg (" exnode" ), py::arg (" label" ) = " " , py::arg (" ignore_parent_rel" ) = false )
246248 .def (" attach" , &BoundPropT::attach)
247249 .def (" __str__" , &BoundPropT::str_)
248250 .def (" __repr__" , &BoundPropT::repr_)
249- .def (" _latex_" , &BoundPropT::latex_);
251+ .def (" _latex_" , &BoundPropT::latex_)
252+ ;
250253 }
251254
252255
@@ -395,10 +398,10 @@ namespace cadabra {
395398 def_prop<Py_Vielbein>(m);
396399 def_prop<Py_InverseVielbein>(m);
397400
398- py::enum_<Indices::position_t >(py_indices, " position_t" )
399- .value (" free" , Indices::free)
400- .value (" fixed" , Indices::fixed)
401- .value (" independent" , Indices::independent)
401+ py::enum_<Indices::position_t >(py_indices, " position_t" , " How to interpret the sub/super-script position of the indices. " )
402+ .value (" free" , Indices::free, " Index positions are arbitrary. " )
403+ .value (" fixed" , Indices::fixed, " Index positions are fixed, but can be changed by canonicalisation. " )
404+ .value (" independent" , Indices::independent, " Index positions are independent and should never change. " )
402405 .export_values ();
403406
404407
0 commit comments