Ignore:
Timestamp:
Jan 24, 2024, 4:53:03 PM (21 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
d203d1e
Parents:
d083cc
git-author:
Frederik Heber <frederik.heber@…> (01/22/24 22:21:29)
git-committer:
Frederik Heber <frederik.heber@…> (01/24/24 16:53:03)
Message:

Added python actions to generate all graph6 strings.

  • graph6 strings don't take permutations in the adjacency matrix into account. Hence, we are going through every permutation of non-hydrogens and generate the respective graph6 string.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Python/PythonScripting_impl.hpp

    rd083cc r5a479d  
    110110      "returns list of elements over the nodes of the graph of the current selected set of atoms."
    111111  );
     112  boost::python::def< MoleCuilder::detail::stringVec() >(
     113      "getAllGraph6Strings",
     114      MoleCuilder::detail::module_getAllGraph6Strings,
     115      "returns chemical graphs of the current selected set of atoms as graph6 representation with all non-hydrogen atom permutations."
     116  );
     117  boost::python::def< MoleCuilder::detail::stringVec() >(
     118      "getAllElementListAsStrings",
     119      MoleCuilder::detail::module_getAllElementListAsStrings,
     120      "returns lists of elements over the nodes of the graph of the current selected set of atoms with all non-hydrogen atom permutations."
     121  );
    112122  boost::python::def< MoleCuilder::detail::doubleVec() >(
    113123      "getBoundingBox",
     
    183193      .def("__iter__", boost::python::iterator< std::vector< std::vector< double > > >())
    184194      .def("__repr__", &MoleCuilder::PythonTypes::vec_item< std::vector< std::vector< double > > >::toStringRepr)
     195  ;
     196  // positions
     197  boost::python::class_< std::vector< std::string > >("PythonType_stringVec")
     198      .def("__len__", &std::vector< std::string >::size)
     199      .def("clear", &std::vector< std::string >::clear)
     200      .def("append", &MoleCuilder::PythonTypes::vec_item< std::vector< std::string > >::add,
     201            boost::python::with_custodian_and_ward<1, 2>()) // let container keep value
     202      .def("__getitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< std::string > >::get,
     203           boost::python::return_value_policy<boost::python::copy_non_const_reference>())
     204      .def("__setitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< std::string > >::set,
     205           boost::python::with_custodian_and_ward<1,2>()) // to let container keep value
     206      .def("__delitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< std::string > >::del)
     207      .def("__iter__", boost::python::iterator< std::vector< std::string > >())
     208      .def("__repr__", &MoleCuilder::PythonTypes::vec_item< std::vector< std::string > >::toStringRepr)
    185209  ;
    186210
Note: See TracChangeset for help on using the changeset viewer.