quasardb 3.13.6__cp36-cp36m-win_amd64.whl → 3.13.7__cp36-cp36m-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of quasardb might be problematic. Click here for more details.
- quasardb/CMakeFiles/generate.stamp.depend +1 -1
- quasardb/CMakeLists.txt +43 -22
- quasardb/INSTALL.vcxproj +11 -11
- quasardb/INSTALL.vcxproj.filters +2 -2
- quasardb/__init__.py +1 -1
- quasardb/add_boost_test.cmake +43 -0
- quasardb/batch_column.hpp +1 -1
- quasardb/batch_inserter.hpp +1 -1
- quasardb/blob.hpp +1 -1
- quasardb/cluster.hpp +42 -17
- quasardb/cmake_install.cmake +4 -4
- quasardb/concepts.hpp +30 -16
- quasardb/continuous.hpp +1 -1
- quasardb/convert/array.hpp +61 -7
- quasardb/convert/point.hpp +16 -11
- quasardb/convert/range.hpp +19 -25
- quasardb/convert/unicode.hpp +457 -149
- quasardb/convert/value.hpp +87 -18
- quasardb/convert.hpp +1 -1
- quasardb/date/ALL_BUILD.vcxproj +21 -21
- quasardb/date/ALL_BUILD.vcxproj.filters +1 -1
- quasardb/date/CMakeFiles/generate.stamp.depend +1 -1
- quasardb/date/INSTALL.vcxproj +11 -11
- quasardb/date/INSTALL.vcxproj.filters +2 -2
- quasardb/date/cmake_install.cmake +6 -6
- quasardb/date/date.sln +31 -31
- quasardb/date/dateTargets.cmake +2 -2
- quasardb/detail/qdb_resource.hpp +6 -6
- quasardb/detail/ts_column.hpp +1 -1
- quasardb/direct_blob.hpp +1 -1
- quasardb/direct_handle.hpp +1 -1
- quasardb/direct_integer.hpp +1 -1
- quasardb/{version.cpp → double.hpp} +46 -28
- quasardb/entry.hpp +1 -1
- quasardb/error.hpp +14 -10
- quasardb/handle.hpp +1 -1
- quasardb/integer.hpp +1 -1
- quasardb/logger.hpp +1 -1
- quasardb/masked_array.hpp +1 -1
- quasardb/module.cpp +73 -0
- quasardb/module.hpp +24 -0
- quasardb/node.hpp +16 -11
- quasardb/numpy/__init__.py +76 -7
- quasardb/numpy.hpp +1 -1
- quasardb/options.hpp +31 -9
- quasardb/pandas/__init__.py +1 -1
- quasardb/perf.hpp +6 -6
- quasardb/pinned_writer.hpp +1 -5
- quasardb/pybind11/ALL_BUILD.vcxproj +25 -25
- quasardb/pybind11/ALL_BUILD.vcxproj.filters +1 -1
- quasardb/pybind11/CMakeFiles/generate.stamp.depend +4 -4
- quasardb/pybind11/INSTALL.vcxproj +11 -11
- quasardb/pybind11/INSTALL.vcxproj.filters +2 -2
- quasardb/pybind11/cmake_install.cmake +1 -1
- quasardb/pybind11/pybind11.sln +31 -31
- quasardb/pytypes.hpp +2 -2
- quasardb/qdb_api.dll +0 -0
- quasardb/quasardb.pyd +0 -0
- quasardb/query.cpp +3 -3
- quasardb/query.hpp +1 -1
- quasardb/range-v3/ALL_BUILD.vcxproj +25 -25
- quasardb/range-v3/ALL_BUILD.vcxproj.filters +1 -1
- quasardb/range-v3/CMakeFiles/generate.stamp.depend +6 -6
- quasardb/range-v3/INSTALL.vcxproj +11 -11
- quasardb/range-v3/INSTALL.vcxproj.filters +2 -2
- quasardb/range-v3/Range-v3.sln +39 -39
- quasardb/range-v3/cmake_install.cmake +6 -6
- quasardb/range-v3/range-v3-config.cmake +3 -3
- quasardb/range-v3/range.v3.headers.vcxproj +338 -338
- quasardb/range-v3/range.v3.headers.vcxproj.filters +315 -315
- quasardb/reader/ts_row.hpp +1 -1
- quasardb/reader/ts_value.hpp +1 -1
- quasardb/string.hpp +160 -0
- quasardb/table.hpp +1 -1
- quasardb/table_reader.hpp +1 -1
- quasardb/tag.hpp +1 -1
- quasardb/timestamp.hpp +97 -0
- quasardb/utils.hpp +1 -1
- {quasardb-3.13.6.dist-info → quasardb-3.13.7.dist-info}/LICENSE.md +1 -1
- {quasardb-3.13.6.dist-info → quasardb-3.13.7.dist-info}/METADATA +1 -1
- quasardb-3.13.7.dist-info/RECORD +114 -0
- {quasardb-3.13.6.dist-info → quasardb-3.13.7.dist-info}/WHEEL +1 -1
- quasardb/qdb_client.cpp +0 -67
- quasardb/version.hpp +0 -43
- quasardb-3.13.6.dist-info/RECORD +0 -111
- {quasardb-3.13.6.dist-info → quasardb-3.13.7.dist-info}/top_level.txt +0 -0
quasardb/convert/array.hpp
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Official Python API
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
|
|
6
6
|
* All rights reserved.
|
|
7
7
|
*
|
|
8
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -79,8 +79,8 @@ struct convert_array;
|
|
|
79
79
|
//
|
|
80
80
|
/////
|
|
81
81
|
template <typename From, typename To>
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
requires(concepts::dtype<From> && !concepts::delegate_dtype<From> && concepts::qdb_primitive<To>) struct
|
|
83
|
+
convert_array<From, To>
|
|
84
84
|
{
|
|
85
85
|
using value_type = typename From::value_type;
|
|
86
86
|
static constexpr value_converter<From, To> const xform_{};
|
|
@@ -105,8 +105,7 @@ struct convert_array<From, To>
|
|
|
105
105
|
//
|
|
106
106
|
/////
|
|
107
107
|
template <typename From, typename To>
|
|
108
|
-
|
|
109
|
-
struct convert_array<From, To>
|
|
108
|
+
requires(concepts::delegate_dtype<From> && concepts::qdb_primitive<To>) struct convert_array<From, To>
|
|
110
109
|
{
|
|
111
110
|
// Source value_type, e.g. std::int32_t
|
|
112
111
|
using value_type = typename From::value_type;
|
|
@@ -145,8 +144,7 @@ struct convert_array<From, To>
|
|
|
145
144
|
//
|
|
146
145
|
/////
|
|
147
146
|
template <typename From, typename To>
|
|
148
|
-
|
|
149
|
-
struct convert_array<From, To>
|
|
147
|
+
requires(concepts::qdb_primitive<From> && !concepts::delegate_dtype<To>) struct convert_array<From, To>
|
|
150
148
|
{
|
|
151
149
|
static constexpr value_converter<From, To> const xform_{};
|
|
152
150
|
|
|
@@ -156,6 +154,49 @@ struct convert_array<From, To>
|
|
|
156
154
|
};
|
|
157
155
|
};
|
|
158
156
|
|
|
157
|
+
/////
|
|
158
|
+
//
|
|
159
|
+
// qdb->numpy
|
|
160
|
+
// "Delegate" transforms
|
|
161
|
+
//
|
|
162
|
+
// In some cases numpy's representations are more rich than what Quasardb's primitives
|
|
163
|
+
// support, e.g. int32. In this case, we first transform this to the "delegate type",
|
|
164
|
+
// int64, which can then figure out the rest.
|
|
165
|
+
//
|
|
166
|
+
// Input: range of length N, type: qdb_primitive
|
|
167
|
+
// Output: range of length N, dtype: To
|
|
168
|
+
//
|
|
169
|
+
/////
|
|
170
|
+
template <typename From, typename To>
|
|
171
|
+
requires(concepts::qdb_primitive<From> && concepts::delegate_dtype<To>) struct convert_array<From, To>
|
|
172
|
+
{
|
|
173
|
+
// Destination value_type, e.g. std::int32_t
|
|
174
|
+
using value_type = typename To::value_type;
|
|
175
|
+
|
|
176
|
+
// Delegate dtype, e.g. traits::int64_dtype
|
|
177
|
+
using Delegate = typename To::delegate_type;
|
|
178
|
+
|
|
179
|
+
// Delegate value_type, e.g. std::int64_t
|
|
180
|
+
using delegate_value_type = typename Delegate::value_type;
|
|
181
|
+
|
|
182
|
+
static constexpr convert_array<From, Delegate> const delegate{};
|
|
183
|
+
|
|
184
|
+
[[nodiscard]] constexpr inline auto operator()() const noexcept
|
|
185
|
+
{
|
|
186
|
+
auto xform = [](value_type const & x) -> delegate_value_type {
|
|
187
|
+
if (To::is_null(x))
|
|
188
|
+
{
|
|
189
|
+
return Delegate::null_value();
|
|
190
|
+
}
|
|
191
|
+
else
|
|
192
|
+
{
|
|
193
|
+
return static_cast<delegate_value_type>(x);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
return ranges::views::transform(xform) | delegate();
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
|
|
159
200
|
}; // namespace qdb::convert::detail
|
|
160
201
|
|
|
161
202
|
namespace qdb::convert
|
|
@@ -225,4 +266,17 @@ static inline constexpr std::vector<To> masked_array(qdb::masked_array const & x
|
|
|
225
266
|
return array<From, To>(xs.filled<From>());
|
|
226
267
|
}
|
|
227
268
|
|
|
269
|
+
// qdb -> numpy
|
|
270
|
+
template <concepts::qdb_primitive From, concepts::dtype To, ranges::input_range R>
|
|
271
|
+
requires(concepts::input_range_t<R, From>) static inline qdb::masked_array masked_array(R && xs)
|
|
272
|
+
{
|
|
273
|
+
if (ranges::empty(xs)) [[unlikely]]
|
|
274
|
+
{
|
|
275
|
+
return {};
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
py::array xs_ = detail::to_array<To>(xs | detail::convert_array<From, To>{}());
|
|
279
|
+
return qdb::masked_array(xs_, qdb::masked_array::masked_null<To>(xs_));
|
|
280
|
+
}
|
|
281
|
+
|
|
228
282
|
}; // namespace qdb::convert
|
quasardb/convert/point.hpp
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Official Python API
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
|
|
6
6
|
* All rights reserved.
|
|
7
7
|
*
|
|
8
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -58,12 +58,10 @@ namespace py = pybind11;
|
|
|
58
58
|
////////////////////////////////////////////////////////////////////////////////
|
|
59
59
|
|
|
60
60
|
template <typename T>
|
|
61
|
-
|
|
62
|
-
using point_type = typename traits::qdb_value<T>::point_type;
|
|
61
|
+
requires(concepts::qdb_primitive<T>) using point_type = typename traits::qdb_value<T>::point_type;
|
|
63
62
|
|
|
64
63
|
template <typename T>
|
|
65
|
-
|
|
66
|
-
using primitive_type = typename traits::qdb_value<T>::primitive_type;
|
|
64
|
+
requires(concepts::qdb_point<T>) using primitive_type = typename traits::qdb_value<T>::primitive_type;
|
|
67
65
|
|
|
68
66
|
// Base declaration of pair-to-point function
|
|
69
67
|
template <concepts::qdb_primitive T>
|
|
@@ -136,8 +134,7 @@ struct convert_point_array;
|
|
|
136
134
|
//
|
|
137
135
|
/////
|
|
138
136
|
template <typename From, typename To>
|
|
139
|
-
|
|
140
|
-
struct convert_point_array<From, To>
|
|
137
|
+
requires(concepts::dtype<From> && concepts::qdb_primitive<To>) struct convert_point_array<From, To>
|
|
141
138
|
{
|
|
142
139
|
static constexpr convert_array<From, To> const value_delegate_{};
|
|
143
140
|
static constexpr convert_array<traits::datetime64_ns_dtype, qdb_timespec_t> const ts_delegate_{};
|
|
@@ -176,8 +173,7 @@ struct convert_point_array<From, To>
|
|
|
176
173
|
//
|
|
177
174
|
/////
|
|
178
175
|
template <typename From, typename To>
|
|
179
|
-
|
|
180
|
-
struct convert_point_array<From, To>
|
|
176
|
+
requires(concepts::qdb_primitive<From> && concepts::dtype<To>) struct convert_point_array<From, To>
|
|
181
177
|
{
|
|
182
178
|
static constexpr convert_array<From, To> const value_delegate_{};
|
|
183
179
|
static constexpr convert_array<qdb_timespec_t, traits::datetime64_ns_dtype> const ts_delegate_{};
|
|
@@ -192,6 +188,7 @@ struct convert_point_array<From, To>
|
|
|
192
188
|
|
|
193
189
|
auto timestamps_ = timestamps | ts_delegate_();
|
|
194
190
|
auto values_ = values | value_delegate_();
|
|
191
|
+
|
|
195
192
|
return std::make_pair(timestamps_, values_);
|
|
196
193
|
}
|
|
197
194
|
};
|
|
@@ -288,13 +285,21 @@ static inline std::vector<point_type<To>> point_array(
|
|
|
288
285
|
return point_array<From, To>(timestamps, values.filled<From>());
|
|
289
286
|
};
|
|
290
287
|
|
|
288
|
+
// numpy -> qdb
|
|
289
|
+
template <concepts::dtype From, concepts::qdb_primitive To>
|
|
290
|
+
static inline std::vector<point_type<To>> point_array(
|
|
291
|
+
std::pair<py::array, qdb::masked_array> const & xs)
|
|
292
|
+
{
|
|
293
|
+
return point_array<From, To>(std::get<0>(xs), std::get<1>(xs));
|
|
294
|
+
};
|
|
295
|
+
|
|
291
296
|
// qdb -> numpy
|
|
292
297
|
//
|
|
293
298
|
// Takes a range of qdb point structs (eg qdb_ts_double_point) and returns a pair of two
|
|
294
299
|
// numpy ndarrays, one for timestamps and another for the values.
|
|
295
300
|
template <concepts::qdb_primitive From, concepts::dtype To, ranges::input_range R>
|
|
296
|
-
|
|
297
|
-
|
|
301
|
+
requires(concepts::input_range_t<R, point_type<From>>) static inline std::pair<py::array,
|
|
302
|
+
qdb::masked_array> point_array(R && xs)
|
|
298
303
|
{
|
|
299
304
|
if (ranges::empty(xs)) [[unlikely]]
|
|
300
305
|
{
|
quasardb/convert/range.hpp
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Official Python API
|
|
4
4
|
*
|
|
5
|
-
* Copyright (c) 2009-
|
|
5
|
+
* Copyright (c) 2009-2023, quasardb SAS. All rights reserved.
|
|
6
6
|
* All rights reserved.
|
|
7
7
|
*
|
|
8
8
|
* Redistribution and use in source and binary forms, with or without
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#include "../concepts.hpp"
|
|
34
34
|
#include "../error.hpp"
|
|
35
|
+
#include "unicode.hpp"
|
|
35
36
|
#include "util.hpp"
|
|
36
37
|
#include <range/v3/algorithm/all_of.hpp>
|
|
37
38
|
#include <range/v3/algorithm/copy.hpp>
|
|
@@ -51,8 +52,7 @@ namespace qdb::convert::detail
|
|
|
51
52
|
namespace py = pybind11;
|
|
52
53
|
|
|
53
54
|
template <concepts::dtype DType>
|
|
54
|
-
|
|
55
|
-
struct clean_stride
|
|
55
|
+
requires(concepts::variable_width_dtype<DType>) struct clean_stride
|
|
56
56
|
{
|
|
57
57
|
using stride_type = typename DType::stride_type; // e.g. std::u32string
|
|
58
58
|
using value_type = typename stride_type::value_type; // e.g. wchar_t
|
|
@@ -60,8 +60,8 @@ struct clean_stride
|
|
|
60
60
|
static constexpr value_type const null_value_ = DType::null_value();
|
|
61
61
|
|
|
62
62
|
template <concepts::input_range_t<value_type> InputRange>
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
requires(ranges::sized_range<InputRange>) inline decltype(auto) operator()(
|
|
64
|
+
InputRange && stride) const noexcept
|
|
65
65
|
{
|
|
66
66
|
|
|
67
67
|
auto first = ranges::begin(stride);
|
|
@@ -83,8 +83,7 @@ struct clean_stride
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
template <concepts::dtype DType>
|
|
86
|
-
|
|
87
|
-
inline decltype(auto) to_range(py::array const & xs)
|
|
86
|
+
requires(concepts::fixed_width_dtype<DType>) inline decltype(auto) to_range(py::array const & xs)
|
|
88
87
|
{
|
|
89
88
|
// Lowest-level codepoint representation inside numpy, e.g. wchar_t for unicode
|
|
90
89
|
// or short for int16.
|
|
@@ -98,17 +97,15 @@ inline decltype(auto) to_range(py::array const & xs)
|
|
|
98
97
|
py::ssize_t stride_size{0};
|
|
99
98
|
switch (xs.ndim())
|
|
100
99
|
{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
stride_size = xs.itemsize();
|
|
100
|
+
// This can happen in case an array contains only a single number, then it will
|
|
101
|
+
// not have any dimensions. In this case, it's best to just use the itemsize as
|
|
102
|
+
// the stride size, because we'll not have to forward the iterator anyway.
|
|
103
|
+
[[unlikely]] case 0 : stride_size = xs.itemsize();
|
|
106
104
|
break;
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
stride_size = xs.strides(0);
|
|
106
|
+
// Default case: use stride size of the first (and only) dimension. Most of the
|
|
107
|
+
// time this will be identical to the itemsize.
|
|
108
|
+
[[likely]] case 1 : stride_size = xs.strides(0);
|
|
112
109
|
break;
|
|
113
110
|
default:
|
|
114
111
|
throw qdb::incompatible_type_exception{
|
|
@@ -133,8 +130,7 @@ inline decltype(auto) to_range(py::array const & xs)
|
|
|
133
130
|
|
|
134
131
|
// Variable length encoding: split into chunks of <itemsize() / codepoint_size>
|
|
135
132
|
template <concepts::dtype DType>
|
|
136
|
-
|
|
137
|
-
inline decltype(auto) to_range(py::array const & xs)
|
|
133
|
+
requires(concepts::variable_width_dtype<DType>) inline decltype(auto) to_range(py::array const & xs)
|
|
138
134
|
{
|
|
139
135
|
using stride_type = typename DType::stride_type;
|
|
140
136
|
using value_type = typename stride_type::value_type;
|
|
@@ -190,8 +186,7 @@ inline decltype(auto) to_range(py::array const & xs)
|
|
|
190
186
|
* Converts range R to np.ndarray of dtype DType. Copies underlying data.
|
|
191
187
|
*/
|
|
192
188
|
template <concepts::dtype DType, ranges::input_range R>
|
|
193
|
-
|
|
194
|
-
inline py::array to_array(R && xs)
|
|
189
|
+
requires(concepts::fixed_width_dtype<DType>) inline py::array to_array(R && xs)
|
|
195
190
|
{
|
|
196
191
|
using value_type = typename DType::value_type;
|
|
197
192
|
|
|
@@ -208,8 +203,7 @@ inline py::array to_array(R && xs)
|
|
|
208
203
|
* Converts range R to np.ndarray of dtype DType. Copies underlying data.
|
|
209
204
|
*/
|
|
210
205
|
template <concepts::dtype Dtype, ranges::input_range R>
|
|
211
|
-
|
|
212
|
-
inline py::array to_array(R && xs)
|
|
206
|
+
requires(concepts::variable_width_dtype<Dtype>) inline py::array to_array(R && xs)
|
|
213
207
|
{
|
|
214
208
|
using out_char_type = typename Dtype::value_type;
|
|
215
209
|
|
|
@@ -274,9 +268,9 @@ inline py::array to_array(R && xs)
|
|
|
274
268
|
static_assert(ranges::input_range<decltype(in)>);
|
|
275
269
|
static_assert(ranges::output_range<decltype(out), out_char_type>);
|
|
276
270
|
|
|
277
|
-
assert(ranges::size(out) == stride_size);
|
|
278
|
-
assert(ranges::size(in) <= ranges::size(out));
|
|
279
|
-
assert(ranges::empty(in) == false);
|
|
271
|
+
// assert(ranges::size(out) == stride_size);
|
|
272
|
+
// assert(ranges::size(in) <= ranges::size(out));
|
|
273
|
+
// assert(ranges::empty(in) == false);
|
|
280
274
|
|
|
281
275
|
ranges::copy(in, ranges::begin(out));
|
|
282
276
|
});
|