- 19 Oct, 2021 1 commit
-
-
Henry Schreiner authored
* fix: deprecate make_simple_namespace, fix Python 3.11 * docs: update links
-
- 08 Oct, 2021 1 commit
-
-
Aaron Gokaslan authored
* Add additional pygrep pre-commit hooks * Remove useless noqas with hook * Fix all single rst backticks * Simplify mypy pre-commit hook with upstream fixes * Add back missing comment * Add one last pygrep hook
-
- 22 Sep, 2021 1 commit
-
-
Aaron Gokaslan authored
* Apply blacken-docs and fix language-hints * Add blacken-docs pre-commit hook * Add pycln pre-commit hook * Enable a few builtin hooks * Black no longer ignores pyi files
-
- 17 Sep, 2021 1 commit
-
-
Henry Schreiner authored
-
- 26 Aug, 2021 1 commit
-
-
Jouke Witteveen authored
Co-authored-by:Jouke Witteveen <j.witteveen@cosine.nl>
-
- 12 Jul, 2021 2 commits
-
-
Henry Schreiner authored
-
Ralf W. Grosse-Kunstleve authored
* Adding iostream.h thread-safety documentation. * Restoring `TestThread` code with added `std::lock_guard<std::mutex>`. * Updating new comments to reflect new information. * Fixing up `git rebase -X theirs` accidents.
-
- 17 Jun, 2021 1 commit
-
-
Aaron Gokaslan authored
-
- 08 Dec, 2020 1 commit
-
-
Antony Lee authored
This is nice enough to be mentioned explicitly in the docs.
-
- 15 Oct, 2020 1 commit
-
-
Henry Schreiner authored
-
- 03 Oct, 2020 1 commit
-
-
Henry Schreiner authored
* WIP: module -> module_ without typedef * refactor: allow py::module to work again
-
- 14 Sep, 2020 1 commit
-
-
Boris Staletic authored
Why only for pointers? Because C casts are hard to grep for.
-
- 09 Sep, 2020 1 commit
-
-
Holger Kohr authored
* Add py::object casting example to embedding docs * Move implicit cast example to object.rst * Move to bottom and improve implicit casting text * Fix xref * Improve wording as per @bstaletic's suggestion
-
- 04 Sep, 2020 1 commit
-
-
Eric Cousineau authored
-
- 23 Aug, 2020 1 commit
-
-
Yannick Jadoul authored
-
- 22 Aug, 2020 1 commit
-
-
jbarlow83 authored
The main change is to treat error_already_set as a separate category of exception that arises in different circumstances and needs to be handled differently. The asymmetry between Python and C++ exceptions is further emphasized.
-
- 20 Aug, 2020 1 commit
-
-
Henry Schreiner authored
-
- 04 Aug, 2020 1 commit
-
-
Yannick Jadoul authored
* Enable py::ellipsis on Python 2 * Enable py::ellipsis tests on Python 2 and mention `Ellipsis` in the docs
-
- 23 Jul, 2020 1 commit
-
-
Boris Staletic authored
-
- 20 Jul, 2020 1 commit
-
-
Henry Schreiner authored
-
- 15 Jul, 2020 1 commit
-
-
Kota Yamaguchi authored
* Fix undefined memoryview format * Add missing <algorithm> header * Add workaround for py27 array compatibility * Workaround py27 memoryview behavior * Fix memoryview constructor from buffer_info * Workaround PyMemoryView_FromMemory availability in py27 * Fix up memoryview tests * Update memoryview test from buffer to check signedness * Use static factory method to create memoryview * Remove ndim arg from memoryview::frombuffer and add tests * Allow ndim=0 memoryview and documentation fixup * Use void* to align to frombuffer method signature * Add const variants of frombuffer and frommemory * Add memory view section in doc * Fix docs * Add test for null buffer * Workaround py27 nullptr behavior in test * Rename frombuffer to from_buffer
-
- 30 Jun, 2020 1 commit
-
-
Guilherme Dantas authored
-
- 28 Aug, 2018 1 commit
-
-
Wenzel Jakob authored
This PR adds a new py::ellipsis() method which can be used in conjunction with NumPy's generalized slicing support. For instance, the following is now valid (where "a" is a NumPy array): py::array b = a[py::make_tuple(0, py::ellipsis(), 0)];
-
- 24 Jun, 2018 1 commit
-
-
Thomas Hrabe authored
-
- 21 Sep, 2017 1 commit
-
-
Ansgar Burchardt authored
This also matches the Eigen example for the row-major case. This also enhances one of the tests to trigger a failure (and fixes it in the PR). (This isn't really a flaw in pybind itself, but rather fixes wrong code in the test code and docs).
-
- 13 Sep, 2017 1 commit
-
-
jbarlow83 authored
* Expand documentation to include explicit example of py::module::import where one would expect it. * Describe how to use unbound and bound methods to class Python classes. [skip ci]
-
- 25 Aug, 2017 1 commit
-
-
Henry Schreiner authored
-
- 27 Jun, 2017 1 commit
-
-
Dean Moldovan authored
-
- 29 May, 2017 1 commit
-
-
Dean Moldovan authored
This commit also adds `doc()` to `object_api` as a shortcut for the `attr("__doc__")` accessor. The module macro changes from: ```c++ PYBIND11_PLUGIN(example) { pybind11::module m("example", "pybind11 example plugin"); m.def("add", [](int a, int b) { return a + b; }); return m.ptr(); } ``` to: ```c++ PYBIND11_MODULE(example, m) { m.doc() = "pybind11 example plugin"; m.def("add", [](int a, int b) { return a + b; }); } ``` Using the old macro results in a deprecation warning. The warning actually points to the `pybind11_init` function (since attributes don't bind to macros), but the message should be quite clear: "PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE".
-
- 28 May, 2017 1 commit
-
-
Dean Moldovan authored
-
- 27 May, 2017 1 commit
-
-
chenzy authored
-
- 25 May, 2017 1 commit
-
-
Jason Rhinelander authored
This extends py::vectorize to automatically pass through non-vectorizable arguments. This removes the need for the documented "explicitly exclude an argument" workaround. Vectorization now applies to arithmetic, std::complex, and POD types, passed as plain value or by const lvalue reference (previously only pass-by-value types were supported). Non-const lvalue references and any other types are passed through as-is. Functions with rvalue reference arguments (whether vectorizable or not) are explicitly prohibited: an rvalue reference is inherently not something that can be passed multiple times and is thus unsuitable to being in a vectorized function. The vectorize returned value is also now more sensitive to inputs: previously it would return by value when all inputs are of size 1; this is now amended to having all inputs of size 1 *and* 0 dimensions. Thus if you pass in, for example, [[1]], you get back a 1x1, 2D array, while previously you got back just the resulting single value. Vectorization of member function specializations is now also supported via `py::vectorize(&Class::method)`; this required passthrough support for the initial object pointer on the wrapping function pointer.
-
- 10 May, 2017 2 commits
-
-
Bruce Merry authored
This exposed a few underlying issues: 1. is_pod_struct was too strict to allow this. I've relaxed it to require only trivially copyable and standard layout, rather than POD (which additionally requires a trivial constructor, which std::complex violates). 2. format_descriptor<std::complex<T>>::format() returned numpy format strings instead of PEP3118 format strings, but register_dtype feeds format codes of its fields to _dtype_from_pep3118. I've changed it to return PEP3118 format codes. format_descriptor is a public type, so this may be considered an incompatible change. 3. register_structured_dtype tried to be smart about whether to mark fields as unaligned (with ^). However, it's examining the C++ alignment, rather than what numpy (or possibly PEP3118) thinks the alignment should be. For complex values those are different. I've made it mark all fields as ^ unconditionally, which should always be safe even if they are aligned, because we explicitly mark the padding.
-
Bruce Merry authored
Resolves #800. Both C++ arrays and std::array are supported, including mixtures like std::array<int, 2>[4]. In a multi-dimensional array of char, the last dimension is used to construct a numpy string type.
-
- 08 May, 2017 1 commit
-
-
Dean Moldovan authored
-
- 07 May, 2017 3 commits
-
-
Cris Luengo authored
-
Jason Rhinelander authored
We're current copy by creating an Eigen::Map into the input numpy array, then assigning that to the basic eigen type, effectively having Eigen do the copy. That doesn't work for negative strides, though: Eigen doesn't allow them. This commit makes numpy do the copying instead by allocating the eigen type, then having numpy copy from the input array into a numpy reference into the eigen object's data. This also saves a copy when type conversion is required: numpy can do the conversion on-the-fly as part of the copy. Finally this commit also makes non-reference parameters respect the convert flag, declining the load when called in a noconvert pass with a convertible, but non-array input or an array with the wrong dtype.
-
Cris Luengo authored
-
- 28 Mar, 2017 1 commit
-
-
Dean Moldovan authored
* Support raw string literals as input for py::eval * Dedent only when needed
-
- 22 Mar, 2017 1 commit
-
-
Jason Rhinelander authored
The extends the previous unchecked support with the ability to determine the dimensions at runtime. This incurs a small performance hit when used (versus the compile-time fixed alternative), but is still considerably faster than the full checks on every call that happen with `.at()`/`.mutable_at()`.
-