Skip to content

Commit

Permalink
Merge pull request #98 from ctero-graham/add_getter
Browse files Browse the repository at this point in the history
mod: add two getters, so that we can check the consistancy of the arg…
  • Loading branch information
yurymalkov authored Apr 22, 2019
2 parents 0841142 + 61df77e commit d0716d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python_bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ class Index {
appr_alg->ef_ = ef;
}

size_t get_ef_construction() {
return appr_alg->ef_construction_;
}

size_t get_M() {
return appr_alg->M_;
}

void set_num_threads(int num_threads) {
this->num_threads_default = num_threads;
}
Expand Down Expand Up @@ -373,6 +381,8 @@ PYBIND11_PLUGIN(hnswlib) {
.def("get_items", &Index<float, float>::getDataReturnList, py::arg("ids") = py::none())
.def("get_ids_list", &Index<float>::getIdsList)
.def("set_ef", &Index<float>::set_ef, py::arg("ef"))
.def("get_ef_construction", &Index<float>::get_ef_construction)
.def("get_M", &Index<float>::get_M)
.def("set_num_threads", &Index<float>::set_num_threads, py::arg("num_threads"))
.def("save_index", &Index<float>::saveIndex, py::arg("path_to_index"))
.def("load_index", &Index<float>::loadIndex, py::arg("path_to_index"), py::arg("max_elements")=0)
Expand Down

0 comments on commit d0716d9

Please sign in to comment.