Skip to content

Commit 83a81e3

Browse files
committed
doc fixes
1 parent aa49055 commit 83a81e3

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Both containers enable the numpy-style APIs of xtensor (see [the numpy to xtenso
4545
#include <numeric> // Standard library import for std::accumulate
4646
#include "pybind11/pybind11.h" // Pybind11 import to define Python bindings
4747
#include "xtensor/xmath.hpp" // xtensor import for the C++ universal functions
48+
#define FORCE_IMPORT_ARRAY
4849
#include "xtensor-python/pyarray.hpp" // Numpy bindings
4950

5051
double sum_of_sines(xt::pyarray<double>& m)
@@ -55,6 +56,7 @@ double sum_of_sines(xt::pyarray<double>& m)
5556

5657
PYBIND11_PLUGIN(xtensor_python_test)
5758
{
59+
xt::import_numpy();
5860
pybind11::module m("xtensor_python_test", "Test module for xtensor python bindings");
5961

6062
m.def("sum_of_sines", sum_of_sines, "Sum the sines of the input values");

docs/source/numpy_capi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Thus the basic skeleton of the module looks like:
2525
2626
#include "pybind11/pybind11.h"
2727
#define FORCE_IMPORT_ARRAY
28-
#include "xgtensor-python/pyarray.hpp"
28+
#include "xtensor-python/pyarray.hpp"
2929
3030
PYBIND11_PLUGIN(plugin_name)
3131
{

include/xtensor-python/pyarray.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include "pystrides_adaptor.hpp"
2222
#include "xtensor_type_caster_base.hpp"
2323

24-
#include <iostream>
25-
2624
namespace xt
2725
{
2826
template <class T>

include/xtensor-python/xtensor_type_caster_base.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
/*
1+
/*
22
xtensor-python/xtensor_type_caster.hpp: Transparent conversion for xtensor and xarray
33
4-
This code is based on the following code written by Wenzei Jakob
4+
This code is based on the following code written by Wenzel Jakob
55
66
pybind11/eigen.h: Transparent conversion for dense and sparse Eigen matrices
77
@@ -78,7 +78,7 @@ namespace pybind11
7878
}
7979

8080
private:
81-
81+
8282
// Cast implementation
8383
template <typename CType>
8484
static handle cast_impl(CType* src, return_value_policy policy, handle parent)

0 commit comments

Comments
 (0)