Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/openPMD/binding/python/Mpi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pythonObjectAsMpiComm(pybind11::object &comm)
e_t::is_not_an_mpi_communicator};
// only checks same layout, e.g. an `int` in `PyObject` could pass this
if (!py::isinstance<py::class_<openPMD_PyMPIIntracommObject> >(
comm.get_type()))
py::type::of(comm)))
// TODO add mpi4py version from above import check to error message
return e{
"comm has unexpected type layout in " + comm_str +
Expand Down
6 changes: 3 additions & 3 deletions src/binding/python/Attributable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ template <typename RequestedType>
bool setAttributeFromObject_default(
Attributable &attr, std::string const &key, py::object &obj)
{
if (std::string(py::str(obj.get_type())) == "<class 'list'>")
if (std::string(py::str(py::type::of(obj))) == "<class 'list'>")
{
using ListType = std::vector<RequestedType>;
return attr.setAttribute<ListType>(key, obj.cast<ListType>());
Expand All @@ -289,7 +289,7 @@ bool setAttributeFromObject_default(
bool setAttributeFromObject_double(
Attributable &attr, std::string const &key, py::object &obj)
{
if (std::string(py::str(obj.get_type())) == "<class 'list'>")
if (std::string(py::str(py::type::of(obj))) == "<class 'list'>")
{
using ListType = std::vector<double>;
using ArrayType = std::array<double, 7>;
Expand Down Expand Up @@ -342,7 +342,7 @@ std::optional<TargetType> tryCast(py::object const &obj)
{
TargetType val{};
auto python_val = py::cast(std::move(val));
if (!py::isinstance(obj, python_val.get_type()))
if (!py::isinstance(obj, py::type::of(python_val)))
{
return std::nullopt;
}
Expand Down
5 changes: 4 additions & 1 deletion src/binding/python/Series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,10 @@ not possible once it has been closed.
std::tuple<py::object, std::string>,
std::tuple<py::object, py::object>
#endif
>::template call(cl);
>::template call<py::class_<Series, Attributable> &>(cl);
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// need to explicitly state template parameters, otherwise Clang on
// Windows does not understand that it really is a template

cl.def("__bool__", &Series::operator bool)
.def("__len__", [](Series const &s) { return s.iterations.size(); })
Expand Down
Loading