From bed4224e8c5dcf41884d9d8cb16983a5556c8d2f Mon Sep 17 00:00:00 2001 From: Xian Date: Sat, 9 Sep 2023 16:03:36 +0200 Subject: [PATCH] Update net_handle_t bindings to include equality and hash --- bdsg/cmake_bindings/handlegraph/types.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bdsg/cmake_bindings/handlegraph/types.cpp b/bdsg/cmake_bindings/handlegraph/types.cpp index d8e0da8e..3938cd0b 100644 --- a/bdsg/cmake_bindings/handlegraph/types.cpp +++ b/bdsg/cmake_bindings/handlegraph/types.cpp @@ -50,5 +50,8 @@ void bind_handlegraph_types(std::function< pybind11::module &(std::string const pybind11::class_> cl(M("handlegraph"), "net_handle_t", "A net handle is an opaque reference to a category of traversals of a single\n node, a chain, or the interior of a snarl, in the snarl decomposition of a\n graph.\n\n Snarls and chains are bounded by two particular points, but the traversal\n may not visit both or any of them (as is the case for traversals between\n internal tips).\n\n The handle refers to the snarl or chain itself and also a particular\n category of traversals of it. Each of the start and end of the traversal can\n be the start of the snarl/chain, the end of the snarl/chain, or some\n internal tip, for 6 distinct combinations.\n\n For single nodes, we only have forward and reverse."); cl.def( pybind11::init( [](){ return new handlegraph::net_handle_t(); } ) ); cl.def( pybind11::init( [](handlegraph::net_handle_t const &o){ return new handlegraph::net_handle_t(o); } ) ); + cl.def( pybind11::self == pybind11::self); + cl.def( pybind11::self != pybind11::self); + cl.def( hash(pybind11::self)); } }