Skip to content

Commit

Permalink
Merge pull request #6 from dmcguire81/bugfix/python37_hangs
Browse files Browse the repository at this point in the history
Update to pybind11 v2.3.0 which fixes 3.7-related GIL mismanagement
  • Loading branch information
josecols authored Nov 20, 2022
2 parents 3a02eb2 + 74b3ad4 commit 5946b38
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deps/pybind11
Submodule pybind11 updated 178 files
2 changes: 1 addition & 1 deletion include/metapy_identifiers.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct identifier_caster
using underlying_type = typename Type::underlying_type;
using type_conv = make_caster<underlying_type>;

PYBIND11_TYPE_CASTER(Type, _("id[") + type_conv::name() + _("]"));
PYBIND11_TYPE_CASTER(Type, _("id[") + type_conv::name + _("]"));

bool load(handle src, bool convert)
{
Expand Down
5 changes: 1 addition & 4 deletions include/metapy_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ struct type_caster<meta::index::search_result>
return result.release();
}

static PYBIND11_DESCR name()
{
return type_descr(_("SearchResult"));
}
static constexpr auto name = _("SearchResult");

static handle cast(const meta::index::search_result* sr,
return_value_policy policy, handle parent)
Expand Down
4 changes: 2 additions & 2 deletions include/metapy_probe_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ struct probe_map_caster
return d.release();
}

PYBIND11_TYPE_CASTER(type, _("dict<") + key_conv::name() + _(", ")
+ value_conv::name() + _(">"));
PYBIND11_TYPE_CASTER(type, _("dict<") + key_conv::name + _(", ")
+ value_conv::name + _(">"));
};

template <class Key, class Value, class ProbingStrategy, class Hash,
Expand Down
2 changes: 1 addition & 1 deletion src/metapy_embeddings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void metapy_bind_embeddings(py::module& m)
query,
std::size_t k) {
util::array_view<const double> avquery{query.data(),
query.size()};
static_cast<std::size_t>(query.size())};
auto scores = self.top_k(avquery, k);

std::vector<py::tuple> result;
Expand Down

0 comments on commit 5946b38

Please sign in to comment.