mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-06 07:51:47 +00:00
chore(deps): update pre-commit hooks (#5084)
* chore(deps): update pre-commit hooks updates: - [github.com/pre-commit/mirrors-clang-format: v17.0.6 → v18.1.2](https://github.com/pre-commit/mirrors-clang-format/compare/v17.0.6...v18.1.2) - [github.com/astral-sh/ruff-pre-commit: v0.2.0 → v0.3.5](https://github.com/astral-sh/ruff-pre-commit/compare/v0.2.0...v0.3.5) - [github.com/pre-commit/mirrors-mypy: v1.8.0 → v1.9.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.8.0...v1.9.0) - [github.com/Lucas-C/pre-commit-hooks: v1.5.4 → v1.5.5](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.5.4...v1.5.5) - [github.com/sirosen/texthooks: 0.6.4 → 0.6.6](https://github.com/sirosen/texthooks/compare/0.6.4...0.6.6) - [github.com/shellcheck-py/shellcheck-py: v0.9.0.6 → v0.10.0.1](https://github.com/shellcheck-py/shellcheck-py/compare/v0.9.0.6...v0.10.0.1) - [github.com/PyCQA/pylint: v3.0.3 → v3.1.0](https://github.com/PyCQA/pylint/compare/v3.0.3...v3.1.0) - [github.com/python-jsonschema/check-jsonschema: 0.28.0 → 0.28.1](https://github.com/python-jsonschema/check-jsonschema/compare/0.28.0...0.28.1) * style: pre-commit fixes * fix(types): correction for better typing Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
committed by
GitHub
parent
7f2214bc68
commit
f33f6afb66
@@ -287,8 +287,7 @@ TEST_SUBMODULE(numpy_array, sm) {
|
||||
// [workaround(intel)] ICC 20/21 breaks with py::arg().stuff, using py::arg{}.stuff works.
|
||||
|
||||
// Only accept the exact types:
|
||||
sm.def(
|
||||
"overloaded3", [](const py::array_t<int> &) { return "int"; }, py::arg{}.noconvert());
|
||||
sm.def("overloaded3", [](const py::array_t<int> &) { return "int"; }, py::arg{}.noconvert());
|
||||
sm.def(
|
||||
"overloaded3",
|
||||
[](const py::array_t<double> &) { return "double"; },
|
||||
@@ -444,9 +443,8 @@ TEST_SUBMODULE(numpy_array, sm) {
|
||||
});
|
||||
|
||||
// resize to 3D array with each dimension = N
|
||||
sm.def("array_resize3", [](py::array_t<double> a, size_t N, bool refcheck) {
|
||||
a.resize({N, N, N}, refcheck);
|
||||
});
|
||||
sm.def("array_resize3",
|
||||
[](py::array_t<double> a, size_t N, bool refcheck) { a.resize({N, N, N}, refcheck); });
|
||||
|
||||
// test_array_create_and_resize
|
||||
// return 2D array with Nrows = Ncols = N
|
||||
@@ -460,9 +458,8 @@ TEST_SUBMODULE(numpy_array, sm) {
|
||||
sm.def("array_view",
|
||||
[](py::array_t<uint8_t> a, const std::string &dtype) { return a.view(dtype); });
|
||||
|
||||
sm.def("reshape_initializer_list", [](py::array_t<int> a, size_t N, size_t M, size_t O) {
|
||||
return a.reshape({N, M, O});
|
||||
});
|
||||
sm.def("reshape_initializer_list",
|
||||
[](py::array_t<int> a, size_t N, size_t M, size_t O) { return a.reshape({N, M, O}); });
|
||||
sm.def("reshape_tuple", [](py::array_t<int> a, const std::vector<int> &new_shape) {
|
||||
return a.reshape(new_shape);
|
||||
});
|
||||
@@ -471,8 +468,7 @@ TEST_SUBMODULE(numpy_array, sm) {
|
||||
[](const py::array &a) { return a[py::make_tuple(0, py::ellipsis(), 0)]; });
|
||||
|
||||
// test_argument_conversions
|
||||
sm.def(
|
||||
"accept_double", [](const py::array_t<double, 0> &) {}, py::arg("a"));
|
||||
sm.def("accept_double", [](const py::array_t<double, 0> &) {}, py::arg("a"));
|
||||
sm.def(
|
||||
"accept_double_forcecast",
|
||||
[](const py::array_t<double, py::array::forcecast> &) {},
|
||||
@@ -493,8 +489,7 @@ TEST_SUBMODULE(numpy_array, sm) {
|
||||
"accept_double_f_style_forcecast",
|
||||
[](const py::array_t<double, py::array::forcecast | py::array::f_style> &) {},
|
||||
py::arg("a"));
|
||||
sm.def(
|
||||
"accept_double_noconvert", [](const py::array_t<double, 0> &) {}, "a"_a.noconvert());
|
||||
sm.def("accept_double_noconvert", [](const py::array_t<double, 0> &) {}, "a"_a.noconvert());
|
||||
sm.def(
|
||||
"accept_double_forcecast_noconvert",
|
||||
[](const py::array_t<double, py::array::forcecast> &) {},
|
||||
|
||||
Reference in New Issue
Block a user