Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/Python bindings broke because of SnarlDistanceIndex #160

Open
adamnovak opened this issue Aug 22, 2022 · 1 comment
Open

Docs/Python bindings broke because of SnarlDistanceIndex #160

adamnovak opened this issue Aug 22, 2022 · 1 comment
Assignees

Comments

@adamnovak
Copy link
Member

The ReadTheDocs builds have been failing for a while with:

ImportError: overloading a method with both static and instance methods is not supported; error while attempting to bind instance method SnarlDistanceIndex.get_net_handle(self: bdsg.bdsg.SnarlDistanceIndex, pointer: int, connectivity: bdsg.bdsg.SnarlDistanceIndex.connectivity_t) -> bdsg.handlegraph.net_handle_t

I think the code that makes the Python bindings can't handle having both static and non-static methods with the same name, which we do here:

const static handlegraph::net_handle_t get_net_handle(size_t pointer, connectivity_t connectivity, net_handle_record_t type, size_t node_offset=0) {
if (pointer > ((size_t)1 << (64-BITS_FOR_TRIVIAL_NODE_OFFSET-3-4))-1) {
throw runtime_error("error: don't have space in net handle for record offset");
}
net_handle_t handle = as_net_handle((((((pointer << BITS_FOR_TRIVIAL_NODE_OFFSET) | node_offset) << 4) | connectivity)<<3) | type);
return handle;
}
handlegraph::net_handle_t get_net_handle(size_t pointer, connectivity_t connectivity) const {
net_handle_record_t type = SnarlTreeRecord(pointer, &snarl_tree_records).get_record_handle_type();
size_t node_record_offset = SnarlTreeRecord(pointer, &snarl_tree_records).get_record_type() == SIMPLE_SNARL ||
SnarlTreeRecord(pointer, &snarl_tree_records).get_record_type() == SIMPLE_SNARL ? 1 : 0;
return get_net_handle(pointer, connectivity, type, node_record_offset);
}
handlegraph::net_handle_t get_net_handle(size_t pointer) const {
net_handle_record_t type = SnarlTreeRecord(pointer, &snarl_tree_records).get_record_handle_type();
return get_net_handle(pointer, START_END, type);
}

@xchang1 Can you rename the static version of the method and see if the ReadTheDocs builds start working again? If you make a ReadTheDocs account I can give you access to the project to get the logs.

This was referenced Aug 22, 2022
@xchang1
Copy link
Contributor

xchang1 commented Aug 22, 2022

Ok, I renamed the static version of the method and I made a ReadTheDocs account, xchang1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants