vgteam / libbdsg

Optimized sequence graph implementations for graph genomics
MIT License
33 stars 6 forks source link

Update net_handle_t bindings to include equality and hash #190

Open xchang1 opened 1 year ago

xchang1 commented 1 year ago

I wanted net_handle_t's to be used in sets in python so I needed the bindings to include equality and hashing.

@adamnovak or maybe @ctcisar, can I do this? It looks like the binding code is automatically generated so I'm worried it'll get overwritten, but this was the only way I could figure out to get it to do what I wanted

adamnovak commented 3 months ago

I don't think this will stick around. I think we would need a member operator== for BInder to bind it to Python's equality check: https://cppbinder.readthedocs.io/en/latest/limitations.html#external-operators

If we want to customize the bindings for a type, we can use an +add_on_binder directive in the Binder config file, break this code out into its own function that takes I think cl as an argument, and then get Binder to generate the code to call that function: https://cppbinder.readthedocs.io/en/latest/config.html?highlight=add_on_binder#config-file-directives