diff --git a/example/example.cpp b/example/example.cpp index 9eea762e9..e7a3ffc51 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -22,7 +22,7 @@ void init_ex10(py::module &); void init_ex11(py::module &); void init_ex12(py::module &); -PYTHON_PLUGIN(example) { +PYBIND_PLUGIN(example) { py::module m("example", "pybind example plugin"); init_ex1(m); diff --git a/example/example10.cpp b/example/example10.cpp index 4a0339776..80f789028 100644 --- a/example/example10.cpp +++ b/example/example10.cpp @@ -26,7 +26,7 @@ void init_ex10(py::module &m) { // Vectorize a lambda function with a capture object (e.g. to exclude some arguments from the vectorization) m.def("vectorized_func2", - [](py::array_dtype x, py::array_dtype y, float z) { + [](py::array_t x, py::array_t y, float z) { return py::vectorize([z](int x, float y) { return my_func(x, y, z); })(x, y); } ); diff --git a/include/pybind/common.h b/include/pybind/common.h index cfd387952..427bce705 100644 --- a/include/pybind/common.h +++ b/include/pybind/common.h @@ -16,11 +16,11 @@ #define NAMESPACE_END(name) } #endif -#if !defined(PYTHON_EXPORT) +#if !defined(PYBIND_EXPORT) #if defined(WIN32) || defined(_WIN32) -#define PYTHON_EXPORT __declspec(dllexport) +#define PYBIND_EXPORT __declspec(dllexport) #else -#define PYTHON_EXPORT __attribute__ ((visibility("default"))) +#define PYBIND_EXPORT __attribute__ ((visibility("default"))) #endif #endif @@ -61,11 +61,11 @@ #endif #if PY_MAJOR_VERSION >= 3 -#define PYTHON_PLUGIN(name) \ - extern "C" PYTHON_EXPORT PyObject *PyInit_##name() +#define PYBIND_PLUGIN(name) \ + extern "C" PYBIND_EXPORT PyObject *PyInit_##name() #else -#define PYTHON_PLUGIN(name) \ - extern "C" PYTHON_EXPORT PyObject *init##name() +#define PYBIND_PLUGIN(name) \ + extern "C" PYBIND_EXPORT PyObject *init##name() #endif NAMESPACE_BEGIN(pybind) diff --git a/include/pybind/numpy.h b/include/pybind/numpy.h index 30428003f..93a3c6bee 100644 --- a/include/pybind/numpy.h +++ b/include/pybind/numpy.h @@ -124,10 +124,10 @@ protected: } }; -template class array_dtype : public array { +template class array_t : public array { public: - PYBIND_OBJECT_CVT(array_dtype, array, is_non_null, m_ptr = ensure(m_ptr)); - array_dtype() : array() { } + PYBIND_OBJECT_CVT(array_t, array, is_non_null, m_ptr = ensure(m_ptr)); + array_t() : array() { } static bool is_non_null(PyObject *ptr) { return ptr != nullptr; } PyObject *ensure(PyObject *ptr) { if (ptr == nullptr) @@ -151,14 +151,14 @@ DECL_FMT(std::complex, NPY_CDOUBLE); NAMESPACE_BEGIN(detail) PYBIND_TYPE_CASTER_PYTYPE(array) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype) PYBIND_TYPE_CASTER_PYTYPE(array_dtype) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype) PYBIND_TYPE_CASTER_PYTYPE(array_dtype) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype) PYBIND_TYPE_CASTER_PYTYPE(array_dtype) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype) PYBIND_TYPE_CASTER_PYTYPE(array_dtype) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype) PYBIND_TYPE_CASTER_PYTYPE(array_dtype) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype>) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype>) -PYBIND_TYPE_CASTER_PYTYPE(array_dtype) +PYBIND_TYPE_CASTER_PYTYPE(array_t) PYBIND_TYPE_CASTER_PYTYPE(array_t) +PYBIND_TYPE_CASTER_PYTYPE(array_t) PYBIND_TYPE_CASTER_PYTYPE(array_t) +PYBIND_TYPE_CASTER_PYTYPE(array_t) PYBIND_TYPE_CASTER_PYTYPE(array_t) +PYBIND_TYPE_CASTER_PYTYPE(array_t) PYBIND_TYPE_CASTER_PYTYPE(array_t) +PYBIND_TYPE_CASTER_PYTYPE(array_t) PYBIND_TYPE_CASTER_PYTYPE(array_t) +PYBIND_TYPE_CASTER_PYTYPE(array_t>) +PYBIND_TYPE_CASTER_PYTYPE(array_t>) +PYBIND_TYPE_CASTER_PYTYPE(array_t) template struct vectorize_helper { @@ -167,11 +167,11 @@ struct vectorize_helper { template vectorize_helper(T&&f) : f(std::forward(f)) { } - object operator()(array_dtype... args) { + object operator()(array_t... args) { return run(args..., typename make_index_sequence::type()); } - template object run(array_dtype&... args, index_sequence) { + template object run(array_t&... args, index_sequence) { /* Request buffers from all parameters */ const size_t N = sizeof...(Args); std::array buffers {{ args.request()... }};