Skip to content

Docs/Python bindings broke because of SnarlDistanceIndex #160

Description

@adamnovak

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions