diff --git a/subprojects/robotpy-wpimath/semiwrap/Translation3d.yml b/subprojects/robotpy-wpimath/semiwrap/Translation3d.yml index 408cefbed..78931ebf7 100644 --- a/subprojects/robotpy-wpimath/semiwrap/Translation3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/Translation3d.yml @@ -2,6 +2,7 @@ extra_includes: - geometryToString.h - wpystruct.h - pybind11/eigen.h +- units_numpy_type_caster.h functions: to_json: diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/type_casters/units_numpy_type_caster.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/type_casters/units_numpy_type_caster.h new file mode 100644 index 000000000..85af6dfdd --- /dev/null +++ b/subprojects/robotpy-wpimath/wpimath/_impl/src/type_casters/units_numpy_type_caster.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +namespace pybind11 { +namespace detail { + +template class S> +struct npy_format_descriptor> { + static constexpr auto name = const_name("numpy.float64"); + static constexpr int value = npy_api::NPY_DOUBLE_; + + static pybind11::dtype dtype() { return pybind11::dtype(value); } +}; + +} // namespace detail +} // namespace pybind11