Skip to content

Commit 7cccb49

Browse files
Merge pull request #229 from SylvainCorlay/update-to-xtensor-0.20
Update to xtensor 0.20
2 parents 11d5657 + d6445f1 commit 7cccb49

7 files changed

Lines changed: 21 additions & 23 deletions

File tree

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ install:
2222
- conda update -q conda
2323
- conda info -a
2424
- conda install gtest cmake -c conda-forge
25-
- conda install xtensor=0.19.3 -c conda-forge
25+
- conda install xtensor=0.20.5 -c conda-forge
2626
- cmake -G "NMake Makefiles" -D CMAKE_INSTALL_PREFIX=%MINICONDA%\\LIBRARY -DBUILD_TESTS=ON .
2727
- nmake test_xframe
2828
- cd test

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ install:
109109
- conda config --set always_yes yes --set changeps1 no
110110
- conda update -q conda
111111
- conda install cmake -c conda-forge
112-
- conda install xtensor=0.19.3 -c conda-forge
112+
- conda install xtensor=0.20.5 -c conda-forge
113113
# Testing
114114
- mkdir build
115115
- cd build

include/xframe/xaxis_function.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace xf
5151
using pointer = value_type*;
5252
using const_pointer = const value_type*;
5353
using name_type = detail::common_name_type_t<std::decay_t<xaxis_expression_closure_t<CT>>...>;
54-
using size_type = xt::detail::common_size_type_t<std::decay_t<xaxis_expression_closure_t<CT>>...>;
54+
using size_type = xt::common_size_type_t<std::decay_t<xaxis_expression_closure_t<CT>>...>;
5555

5656
template <std::size_t N = dynamic()>
5757
using selector_sequence_type = detail::xselector_sequence_t<std::pair<name_type, size_type>, N>;

include/xframe/xselecting.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111

1212
#include <limits>
1313

14+
#include "xtl/xmasked_value.hpp"
1415
#include "xtl/xsequence.hpp"
1516
#include "xtl/xoptional.hpp"
1617

17-
#include "xtensor/xmasked_value.hpp"
18-
1918
#include "xframe_utils.hpp"
2019
#include "xcoordinate.hpp"
2120
#include "xdimension.hpp"
@@ -42,9 +41,9 @@ namespace xf
4241
};
4342

4443
template <class T, class B>
45-
struct static_missing_impl<xt::xmasked_value<T, B>>
44+
struct static_missing_impl<xtl::xmasked_value<T, B>>
4645
{
47-
using return_type = xt::xmasked_value<T, B>;
46+
using return_type = xtl::xmasked_value<T, B>;
4847
static inline return_type get()
4948
{
5049
static T val = static_missing_impl<T>::get();

include/xframe/xvariable_function.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ namespace xf
5252
using const_reference = value_type;
5353
using pointer = value_type*;
5454
using const_pointer = const value_type*;
55-
using size_type = xt::detail::common_size_type_t<std::decay_t<CT>...>;
56-
using difference_type = xt::detail::common_difference_type_t<std::decay_t<CT>...>;
55+
using size_type = xt::common_size_type_t<std::decay_t<CT>...>;
56+
using difference_type = xt::common_difference_type_t<std::decay_t<CT>...>;
5757

5858
using shape_type = typename data_type::shape_type;
5959

test/test_fixture_view.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
#include <cstddef>
1313

1414
#include "xtl/xbasic_fixed_string.hpp"
15-
16-
#include "xtensor/xmasked_value.hpp"
15+
#include "xtl/xmasked_value.hpp"
1716

1817
#include "xframe/xvariable_view.hpp"
1918

@@ -28,7 +27,7 @@ namespace xf
2827
using coordinate_view_type = xcoordinate_view<fstring>;
2928
using dimension_type = xdimension<fstring, std::size_t>;
3029
using data_type = xt::xoptional_assembly<xt::xarray<double>, xt::xarray<bool>>;
31-
using masked_data_type = xt::xarray<xt::xmasked_value<xtl::xoptional<double, bool>>>;
30+
using masked_data_type = xt::xarray<xtl::xmasked_value<xtl::xoptional<double, bool>>>;
3231
using variable_type = xvariable_container<coordinate_type, data_type>;
3332
using variable_view_type = xvariable_view<variable_type&>;
3433
using slice_vector = variable_view_type::slice_vector;
@@ -103,7 +102,7 @@ namespace xf
103102
{
104103
for (std::size_t o = 4; o < val.shape()[1]; ++o)
105104
{
106-
val(a, o) = xt::masked<xtl::xoptional<double, bool>>();
105+
val(a, o) = xtl::masked<xtl::xoptional<double, bool>>();
107106
}
108107
}
109108
return val;
@@ -128,11 +127,11 @@ namespace xf
128127

129128
for (std::size_t o = 0; o < val.shape()[1]; ++o)
130129
{
131-
val(6, o) = xt::masked<xtl::xoptional<double, bool>>();
130+
val(6, o) = xtl::masked<xtl::xoptional<double, bool>>();
132131
}
133132
for (std::size_t a = 0; a < val.shape()[0]; ++a)
134133
{
135-
val(a, 0) = xt::masked<xtl::xoptional<double, bool>>();
134+
val(a, 0) = xtl::masked<xtl::xoptional<double, bool>>();
136135
}
137136
return val;
138137
}
@@ -157,11 +156,11 @@ namespace xf
157156
val.fill(5.2);
158157
for (std::size_t o = 0; o < val.shape()[1]; ++o)
159158
{
160-
val(6, o) = xt::masked<xtl::xoptional<double, bool>>();
159+
val(6, o) = xtl::masked<xtl::xoptional<double, bool>>();
161160
}
162161
for (std::size_t a = 0; a < val.shape()[0]; ++a)
163162
{
164-
val(a, 0) = xt::masked<xtl::xoptional<double, bool>>();
163+
val(a, 0) = xtl::masked<xtl::xoptional<double, bool>>();
165164
}
166165
return val;
167166
}

test/test_xvariable_masked_view.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace xf
6262
not_equal(var.axis<int>("ordinate"), 1)
6363
);
6464

65-
auto masked_value = xt::masked<xtl::xoptional<double, bool>>();
65+
auto masked_value = xtl::masked<xtl::xoptional<double, bool>>();
6666

6767
auto expected = masked_var.select<join::inner, 2>({{{"abscissa", "a"}, {"ordinate", 12}}});
6868
EXPECT_EQ(expected, 6);
@@ -88,7 +88,7 @@ namespace xf
8888
not_equal(var.axis<int>("ordinate"), 1)
8989
);
9090

91-
auto masked_value = xt::masked<xtl::xoptional<double, bool>>();
91+
auto masked_value = xtl::masked<xtl::xoptional<double, bool>>();
9292

9393
auto expected = masked_var.select<join::outer, 2>({{{"abscissa", "a"}, {"ordinate", 12}}});
9494
EXPECT_EQ(expected, 6);
@@ -122,7 +122,7 @@ namespace xf
122122
not_equal(var.axis<int>("ordinate"), 1)
123123
);
124124

125-
auto masked_value = xt::masked<xtl::xoptional<double, bool>>();
125+
auto masked_value = xtl::masked<xtl::xoptional<double, bool>>();
126126

127127
EXPECT_EQ(masked_var(0, 6), 6);
128128
masked_var(0, 6) = 7;
@@ -148,7 +148,7 @@ namespace xf
148148
not_equal(var.axis<int>("ordinate"), 1)
149149
);
150150

151-
auto masked_value = xt::masked<xtl::xoptional<double, bool>>();
151+
auto masked_value = xtl::masked<xtl::xoptional<double, bool>>();
152152
EXPECT_EQ(masked_var.element<2>({0, 6}), 6);
153153
EXPECT_EQ(const_masked_var.element({4, 3}), 35);
154154
EXPECT_EQ(masked_var.element({6, 3}), masked_value);
@@ -169,7 +169,7 @@ namespace xf
169169
not_equal(var.axis<int>("ordinate"), 1)
170170
);
171171

172-
auto masked_value = xt::masked<xtl::xoptional<double, bool>>();
172+
auto masked_value = xtl::masked<xtl::xoptional<double, bool>>();
173173
EXPECT_EQ(masked_var.locate("a", 12), 6);
174174
EXPECT_EQ(const_masked_var.locate("g", 5), 35);
175175
EXPECT_EQ(masked_var.locate("m", 5), masked_value);
@@ -191,7 +191,7 @@ namespace xf
191191
not_equal(var.axis<int>("ordinate"), 1)
192192
);
193193

194-
auto masked_value = xt::masked<xtl::xoptional<double, bool>>();
194+
auto masked_value = xtl::masked<xtl::xoptional<double, bool>>();
195195
EXPECT_EQ(masked_var.locate_element({"a", 12}), 6);
196196
EXPECT_EQ(const_masked_var.locate_element({"g", 5}), 35);
197197
EXPECT_EQ(masked_var.locate_element({"m", 5}), masked_value);

0 commit comments

Comments
 (0)