Commit Graph

2915 Commits

Author SHA1 Message Date
Jason Rhinelander
4609beb46e Merge remote-tracking branch 'upstream/master' into ternary-description 2016-07-06 00:49:49 -04:00
Jason Rhinelander
8469f751cb Add _<bool>("s1", "s2") ternary & use TYPE_CASTER
This commit adds an additional _ template function for compile-time
selection between two description strings.  This in turn allows the
elimination of needing two name() methods in type_caster<arithmetic
types> and type_caster<eigen types>, which allows them to start using
PYBIND11_TYPE_CASTER instead, simplifying their code by eliminating all
the code that they are duplicating from the macro.
2016-07-06 00:40:54 -04:00
Wenzel Jakob
22201d08e4 Merge pull request #268 from bennorth/stricter-test
Tighten check() test in eigen.py
2016-07-06 05:45:56 +02:00
Wenzel Jakob
f57133aa2e correction to #266 fix 2016-07-06 05:43:52 +02:00
Ben North
150a0fa786 check(): Stricter check in tests
Previous version would give false 'OK' if, for example, we were supposed
to get [1, 2, 3] but instead got [2, 1, 3].
2016-07-05 21:46:50 +01:00
Ben North
676e29885b Test that check() catches wrong order of elements
Fails --- next commit will tighten test.
2016-07-05 21:46:50 +01:00
Wenzel Jakob
c2f6841c22 Merge pull request #267 from bennorth/non-contiguous-arrays
Non-contiguous arrays
2016-07-05 22:34:36 +02:00
Ben North
7b8d9e0246 Test eigen converts slices of 3d arrays correctly 2016-07-05 21:13:24 +01:00
Ben North
3e0e779322 Tests: Add further '2*' functions for matrices
Add and declare to Python functions

    double_mat_cm() --- compute 2* a column-major matrix
    double_mat_rm() --- compute 2* a row-major matrix

to 'eigen.cpp' tests / example.
2016-07-05 21:13:24 +01:00
Ben North
93594a3857 Fix handling of one-dimensional input arrays
In eigen.h, type_caster<Type>::load():  For the 'ndim == 1' case, use
the 'InnerStride' type because there is only an inner stride for a
vector.  Choose between (n_elts x 1) or (1 x n_elts) according to
whether we're constructing a Vector or a RowVector.
2016-07-05 21:13:24 +01:00
Ben North
4a22091d45 Add tests for doubling row- and col-vectors
Passing a non-contiguous one-dimensional numpy array gives incorrect
results, so three of these tests fail.  The only one passing is the
simple case where the numpy array is contiguous and we are building a
column-major vector.  Subsequent commit will fix the three failing
cases.
2016-07-05 21:13:20 +01:00
Ben North
b063e64b19 Eigen tests: '2*' functions for col-, row-vectors 2016-07-05 21:12:25 +01:00
Wenzel Jakob
c9f69bc35a Merge pull request #266 from jagerman/fix-python27-test-output
Fix test diff output under python2.7
2016-07-05 22:07:34 +02:00
Jason Rhinelander
f23e0b5e95 Fix test diff output under python2.7
PR #220 broke failed test output under python2.7, which doesn't support
the keepends argument to splitlines.
2016-07-05 16:03:43 -04:00
Wenzel Jakob
3b48482f02 Merge pull request #262 from merlinND/make-tuple-error-message
More informative error message when `py::make_tuple` fails
2016-07-01 21:48:14 +02:00
Merlin Nimier-David
68ca3b6343 more informative error message when py::make_tuple fails 2016-07-01 20:35:35 +02:00
Wenzel Jakob
0006259508 switched internal usage of cast_error exception to reference_cast_error 2016-07-01 16:07:35 +02:00
Wenzel Jakob
472ffbba96 more informative error message when py::cast fails 2016-07-01 16:07:24 +02:00
Wenzel Jakob
fb0e2e5dac minor formatting fix 2016-07-01 14:54:24 +02:00
Wenzel Jakob
d7e208c740 Merge pull request #260 from hbruintjes/allow_const_shared
Allow std::enable_shared_from_this when using const element type
2016-07-01 13:38:46 +02:00
hbruintjes
70d2e57b09 Cast to derived holder using container type when using std::enable_shared_from_this.
Allows const types to be used by shared_ptr
2016-07-01 12:39:55 +02:00
Wenzel Jakob
5766c3a609 cindex.py updated 2016-07-01 12:21:53 +02:00
Wenzel Jakob
3eeea6fa61 docs: point out limitations of implicit conversions 2016-06-30 18:10:28 +02:00
Wenzel Jakob
f53e300fbd doc updates 2016-06-30 14:59:23 +02:00
Wenzel Jakob
09e22b4a17 Merge pull request #255 from nafur/patch-1
Added warning about same-address-optimization
2016-06-30 14:48:29 +02:00
Wenzel Jakob
4626b5a4af updated limitations section 2016-06-30 14:46:11 +02:00
nafur
717df75237 Added warning about same-address-optimization
See https://github.com/pybind/pybind11/issues/254
2016-06-28 18:07:11 +02:00
Wenzel Jakob
2353b9b8fa quench C4459 warning on MSVC2015 2016-06-27 16:05:46 +02:00
Wenzel Jakob
37e1f61f54 allow passing a 'return value policy' to handle::operator() 2016-06-22 14:29:13 +02:00
Wenzel Jakob
4a53d38bd4 only deprecate call() function if C++14 is available 2016-06-22 14:02:27 +02:00
Wenzel Jakob
f88af0c127 clarification on static properties (fixes #248) 2016-06-22 13:52:31 +02:00
Wenzel Jakob
407c292080 Merge pull request #247 from aldanor/iterators
Use prefix increment in make_iterator
2016-06-21 15:43:01 +02:00
Wenzel Jakob
9edfd20d40 Merge pull request #245 from bradharmon/callback_examples
Add callback examples with named parameters
2016-06-21 14:27:17 +02:00
Ivan Smirnov
daed1abc9c Switch to using prefix increment in make_iterator 2016-06-17 22:50:34 +01:00
Ivan Smirnov
3ae5bd787f Remove extraneous semicolon (-pedantic warning) 2016-06-17 22:29:10 +01:00
Brad Harmon
835fc06ca4 Add callback examples with named parameters 2016-06-16 13:19:15 -05:00
Wenzel Jakob
a62b3a07ba Merge pull request #244 from JerryAtInnobec/master
Allow pybind11::arg to have 0, false, or "" as default values.
2016-06-15 19:39:03 +02:00
Jerry Gamache
b8f2d1886c Remove unnecessary braces. 2016-06-15 12:55:34 -04:00
Jerry Gamache
c6e0cdfa54 Allow pybind11::arg to have 0, false, or "" as default values. 2016-06-15 12:48:15 -04:00
Wenzel Jakob
663513cf23 release process clarifications 2016-06-14 16:08:31 +02:00
Wenzel Jakob
452da8884f minor .gitignore update 2016-06-14 15:25:53 +02:00
Wenzel Jakob
f85c52901e starting to work on release v1.9 2016-06-14 15:24:47 +02:00
Wenzel Jakob
f950215046 note about semver policy 2016-06-14 15:02:07 +02:00
Wenzel Jakob
1cbe7ef2ac changelog update 2016-06-14 14:55:10 +02:00
Wenzel Jakob
b4dcb8f200 Merge pull request #237 from dean0x7d/pythonlibs
Skip FindPythonLibsNew if PYTHONLIBS_FOUND is defined (fix #236)
2016-06-12 13:03:22 +02:00
Dean Moldovan
e782eb86e9 Skip FindPythonLibsNew if PYTHONLIBS_FOUND is defined (fix #236)
Also:
- Update documented result variables
- Remove long-ago-deprecated variable
2016-06-12 11:06:08 +02:00
Wenzel Jakob
19d95ef09a Merge pull request #226 from dean0x7d/constexpr_arg_check
Check the number of named arguments at compile time
2016-06-04 01:44:05 +02:00
Dean Moldovan
9e62558d52 Check the number of named arguments at compile time 2016-06-04 00:27:32 +02:00
Wenzel Jakob
e3f8cfcbe8 Merge pull request #224 from dean0x7d/udl
Syntax sugar: user-defined literals for arg and str
2016-06-04 00:02:31 +02:00
Dean Moldovan
b3eadfa595 Update docs with _a suffix notation for named arguments 2016-06-03 23:52:56 +02:00