Skip to content

Commit 0a68c99

Browse files
committed
Update bindings
1 parent 4b61a7c commit 0a68c99

31 files changed

+4470
-3899
lines changed

bdsg/cmake_bindings/bdsg.cpp

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#include <map>
2-
#include <algorithm>
3-
#include <functional>
42
#include <memory>
53
#include <stdexcept>
4+
#include <functional>
65
#include <string>
76

87
#include <pybind11/pybind11.h>
@@ -21,19 +20,18 @@ void bind_bdsg_graph_proxy_1(std::function< pybind11::module &(std::string const
2120
void bind_bdsg_internal_wang_hash(std::function< pybind11::module &(std::string const &namespace_) > &M);
2221
void bind_bdsg_internal_mapped_structs(std::function< pybind11::module &(std::string const &namespace_) > &M);
2322
void bind_bdsg_internal_mapped_structs_1(std::function< pybind11::module &(std::string const &namespace_) > &M);
24-
void bind_bdsg_internal_hash_map(std::function< pybind11::module &(std::string const &namespace_) > &M);
23+
void bind_bdsg_internal_utility(std::function< pybind11::module &(std::string const &namespace_) > &M);
2524
void bind_handlegraph_expanding_overlay_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
2625
void bind_bdsg_overlays_strand_split_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
2726
void bind_bdsg_internal_is_single_stranded(std::function< pybind11::module &(std::string const &namespace_) > &M);
2827
void bind_bdsg_internal_eades_algorithm(std::function< pybind11::module &(std::string const &namespace_) > &M);
29-
void bind_bdsg_internal_base_packed_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
3028
void bind_handlegraph_path_position_handle_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
3129
void bind_bdsg_overlays_packed_path_position_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
3230
void bind_bdsg_overlays_packed_path_position_overlay_1(std::function< pybind11::module &(std::string const &namespace_) > &M);
3331
void bind_bdsg_overlays_path_position_overlays(std::function< pybind11::module &(std::string const &namespace_) > &M);
3432
void bind_bdsg_overlays_path_subgraph_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
33+
void bind_bdsg_overlays_reference_path_overlay(std::function< pybind11::module &(std::string const &namespace_) > &M);
3534
void bind_bdsg_overlays_vectorizable_overlays(std::function< pybind11::module &(std::string const &namespace_) > &M);
36-
void bind_bdsg_overlays_vectorizable_overlays_1(std::function< pybind11::module &(std::string const &namespace_) > &M);
3735
void bind_handlegraph_trivially_serializable(std::function< pybind11::module &(std::string const &namespace_) > &M);
3836
void bind_bdsg_packed_graph(std::function< pybind11::module &(std::string const &namespace_) > &M);
3937
void bind_bdsg_snarl_distance_index(std::function< pybind11::module &(std::string const &namespace_) > &M);
@@ -51,22 +49,13 @@ PYBIND11_MODULE(bdsg, root_module) {
5149

5250
modules[""] = root_module;
5351

54-
static std::vector<std::string> const reserved_python_words {"nonlocal", "global", };
55-
56-
auto mangle_namespace_name(
57-
[](std::string const &ns) -> std::string {
58-
if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns;
59-
else return ns+'_';
60-
}
61-
);
62-
6352
std::vector< std::pair<std::string, std::string> > sub_modules {
6453
{"", "bdsg"},
6554
{"bdsg", "algorithms"},
6655
{"", "handlegraph"},
6756
{"", "std"},
6857
};
69-
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
58+
for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule(p.second.c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() );
7059

7160
//pybind11::class_<std::shared_ptr<void>>(M(""), "_encapsulated_data_");
7261

@@ -82,19 +71,18 @@ PYBIND11_MODULE(bdsg, root_module) {
8271
bind_bdsg_internal_wang_hash(M);
8372
bind_bdsg_internal_mapped_structs(M);
8473
bind_bdsg_internal_mapped_structs_1(M);
85-
bind_bdsg_internal_hash_map(M);
74+
bind_bdsg_internal_utility(M);
8675
bind_handlegraph_expanding_overlay_graph(M);
8776
bind_bdsg_overlays_strand_split_overlay(M);
8877
bind_bdsg_internal_is_single_stranded(M);
8978
bind_bdsg_internal_eades_algorithm(M);
90-
bind_bdsg_internal_base_packed_graph(M);
9179
bind_handlegraph_path_position_handle_graph(M);
9280
bind_bdsg_overlays_packed_path_position_overlay(M);
9381
bind_bdsg_overlays_packed_path_position_overlay_1(M);
9482
bind_bdsg_overlays_path_position_overlays(M);
9583
bind_bdsg_overlays_path_subgraph_overlay(M);
84+
bind_bdsg_overlays_reference_path_overlay(M);
9685
bind_bdsg_overlays_vectorizable_overlays(M);
97-
bind_bdsg_overlays_vectorizable_overlays_1(M);
9886
bind_handlegraph_trivially_serializable(M);
9987
bind_bdsg_packed_graph(M);
10088
bind_bdsg_snarl_distance_index(M);

bdsg/cmake_bindings/bdsg.sources

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ bdsg/graph_proxy_1.cpp
1111
bdsg/internal/wang_hash.cpp
1212
bdsg/internal/mapped_structs.cpp
1313
bdsg/internal/mapped_structs_1.cpp
14-
bdsg/internal/hash_map.cpp
14+
bdsg/internal/utility.cpp
1515
handlegraph/expanding_overlay_graph.cpp
1616
bdsg/overlays/strand_split_overlay.cpp
1717
bdsg/internal/is_single_stranded.cpp
1818
bdsg/internal/eades_algorithm.cpp
19-
bdsg/internal/base_packed_graph.cpp
2019
handlegraph/path_position_handle_graph.cpp
2120
bdsg/overlays/packed_path_position_overlay.cpp
2221
bdsg/overlays/packed_path_position_overlay_1.cpp
2322
bdsg/overlays/path_position_overlays.cpp
2423
bdsg/overlays/path_subgraph_overlay.cpp
24+
bdsg/overlays/reference_path_overlay.cpp
2525
bdsg/overlays/vectorizable_overlays.cpp
26-
bdsg/overlays/vectorizable_overlays_1.cpp
2726
handlegraph/trivially_serializable.cpp
2827
bdsg/packed_graph.cpp
2928
bdsg/snarl_distance_index.cpp

0 commit comments

Comments
 (0)