"example/example-numpy-vectorize.py" did not exist on "93a317eca1e370bca319e844600329f0e8d3b014"
- 24 Feb, 2017 3 commits
-
-
Jason Rhinelander authored
Numpy raises ValueError when attempting to modify an array, while py::array is raising a RuntimeError. This changes the exception to a std::domain_error, which gets mapped to the expected ValueError in python.
-
Jason Rhinelander authored
numpy arrays aren't currently properly setting base: by setting `->base` directly, the base doesn't follow what numpy expects and documents (that is, following chained array bases to the root array). This fixes the behaviour by using numpy's PyArray_SetBaseObject to set the base instead, and then updates the tests to reflect the fixed behaviour.
-
Jason Rhinelander authored
* Make string conversion stricter The string conversion logic added in PR #624 for all std::basic_strings was derived from the old std::wstring logic, but that was underused and turns out to have had a bug in accepting almost anything convertible to unicode, while the previous std::string logic was much stricter. This restores the previous std::string logic by only allowing actual unicode or string types. Fixes #685. * Added missing 'requires numpy' decorator (I forgot that the change to a global decorator here is in the not-yet-merged Eigen PR)
-
- 16 Dec, 2016 1 commit
-
-
Wenzel Jakob authored
This commit includes modifications that are needed to get pybind11 to work with PyPy. The full test suite compiles and runs except for a last few functions that are commented out (due to problems in PyPy that were reported on the PyPy bugtracker). Two somewhat intrusive changes were needed to make it possible: two new tags ``py::buffer_protocol()`` and ``py::metaclass()`` must now be specified to the ``class_`` constructor if the class uses the buffer protocol and/or requires a metaclass (e.g. for static properties). Note that this is only for the PyPy version based on Python 2.7 for now. When the PyPy 3.x has caught up in terms of cpyext compliance, a PyPy 3.x patch will follow.
-
- 20 Nov, 2016 1 commit
-
-
Dean Moldovan authored
A flake8 configuration is included in setup.cfg and the checks are executed automatically on Travis: * Ensures a consistent PEP8 code style * Does basic linting to prevent possible bugs
-
- 17 Nov, 2016 1 commit
-
-
Dean Moldovan authored
* `array_t(const object &)` now throws on error * `array_t::ensure()` is intended for casters —- old constructor is deprecated * `array` and `array_t` get default constructors (empty array) * `array` gets a converting constructor * `py::isinstance<array_T<T>>()` checks the type (but not flags) There is only one special thing which must remain: `array_t` gets its own `type_caster` specialization which uses `ensure` instead of a simple check.
-
- 27 Oct, 2016 1 commit
-
-
Wenzel Jakob authored
The current integer caster was unnecessarily strict and rejected various kinds of NumPy integer types when calling C++ functions expecting normal integers. This relaxes the current behavior.
-
- 13 Oct, 2016 1 commit
-
-
Wenzel Jakob authored
-
- 12 Oct, 2016 2 commits
-
-
Wenzel Jakob authored
This patch adds an extra base handle parameter to most ``py::array`` and ``py::array_t<>`` constructors. If specified along with a pointer to data, the base object will be registered within NumPy, which increases the base's reference count. This feature is useful to create shallow copies of C++ or Python arrays while ensuring that the owners of the underlying can't be garbage collected while referenced by NumPy. The commit also adds a simple test function involving a ``wrap()`` function that creates shallow copies of various N-D arrays.
-
Wenzel Jakob authored
- This actually works with no changes, I just wasn't 100% convinced and decided to write a test to see if it's true.
-
- 10 Sep, 2016 2 commits
-
-
Ivan Smirnov authored
-
Ivan Smirnov authored
-