Skip to content

Commit aee7349

Browse files
committed
Update to pybind11 2.1.0
1 parent 6f3b761 commit aee7349

File tree

4 files changed

+14
-33
lines changed

4 files changed

+14
-33
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ install:
2424
- conda info -a
2525
- conda install pytest -c conda-forge
2626
- cd test
27-
- conda install xtensor==0.7.3 pytest numpy pybind11==2.0.1 -c conda-forge
27+
- conda install xtensor==0.8.0 pytest numpy pybind11==2.1.0 -c conda-forge
2828
- xcopy /S %APPVEYOR_BUILD_FOLDER%\include %MINICONDA%\include
2929

3030
build_script:

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ matrix:
3535
packages:
3636
- clang-3.7
3737
env: COMPILER=clang CLANG=3.7
38+
- os: linux
39+
addons:
40+
apt:
41+
sources:
42+
- ubuntu-toolchain-r-test
43+
- llvm-toolchain-precise-3.8
44+
packages:
45+
- clang-3.8
46+
env: COMPILER=clang CLANG=3.8
3847
- os: osx
3948
osx_image: xcode8
4049
compiler: clang
@@ -59,7 +68,7 @@ install:
5968
# Useful for debugging any issues with conda
6069
- conda info -a
6170
- cd test
62-
- conda install xtensor==0.7.3 pytest numpy pybind11==2.0.1 -c conda-forge
71+
- conda install xtensor==0.8.0 pytest numpy pybind11==2.1.0 -c conda-forge
6372
- cp -r $TRAVIS_BUILD_DIR/include/* $HOME/miniconda/include/
6473

6574
script:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ conda install -c conda-forge xtensor-python
3030

3131
| `xtensor-python` | `xtensor` | `pybind11` |
3232
|-------------------|------------|-------------|
33-
| master | 0.7.3 | ^2.0.0 |
33+
| master | 0.8.0 | ^2.1.0 |
3434
| 0.7.1 | 0.7.3 | ^2.0.0 |
3535
| 0.7.0 | 0.7.2 | ^2.0.0 |
3636
| 0.6.1 | 0.7.1 | ^2.0.0 |

include/xtensor-python/pycontainer.hpp

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#include <functional>
1313
#include <numeric>
1414
#include <cmath>
15+
1516
#include "pybind11/pybind11.h"
1617
#include "pybind11/common.h"
1718
#include "pybind11/complex.h"
1819

19-
// Because of layout, otherwise xiterator and xtensor_forward are sufficient
2020
#include "xtensor/xcontainer.hpp"
2121

2222
namespace xt
@@ -91,34 +91,6 @@ namespace xt
9191

9292
namespace detail
9393
{
94-
// TODO : switch on pybind11::is_fmt_numeric when it is available
95-
template <typename T, typename SFINAE = void>
96-
struct is_fmt_numeric
97-
{
98-
static constexpr bool value = false;
99-
};
100-
101-
constexpr int log2(size_t n, int k = 0)
102-
{
103-
return (n <= 1) ? k : log2(n >> 1, k + 1);
104-
}
105-
106-
template <typename T>
107-
struct is_fmt_numeric<T, std::enable_if_t<std::is_arithmetic<T>::value>>
108-
{
109-
static constexpr bool value = true;
110-
static constexpr int index = std::is_same<T, bool>::value ? 0 : 1 + (
111-
std::is_integral<T>::value ? log2(sizeof(T)) * 2 + std::is_unsigned<T>::value : 8 + (
112-
std::is_same<T, double>::value ? 1 : std::is_same<T, long double>::value ? 2 : 0));
113-
};
114-
115-
template <class T>
116-
struct is_fmt_numeric<std::complex<T>>
117-
{
118-
static constexpr bool value = true;
119-
static constexpr int index = is_fmt_numeric<T>::index + 3;
120-
};
121-
12294
template <class T>
12395
struct numpy_traits
12496
{
@@ -136,7 +108,7 @@ namespace xt
136108

137109
using value_type = std::remove_const_t<T>;
138110

139-
static constexpr int type_num = value_list[is_fmt_numeric<value_type>::index];
111+
static constexpr int type_num = value_list[pybind11::detail::is_fmt_numeric<value_type>::index];
140112
};
141113
}
142114

0 commit comments

Comments
 (0)