quasardb 3.14.2.dev1__cp312-cp312-win_amd64.whl → 3.14.2.dev4__cp312-cp312-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.

Files changed (96) hide show
  1. quasardb/INSTALL.vcxproj +10 -5
  2. quasardb/__init__.py +33 -4
  3. quasardb/cmake_install.cmake +6 -0
  4. quasardb/date/ALL_BUILD.vcxproj +10 -9
  5. quasardb/date/CMakeFiles/Export/df49adab93b9e0c10c64f72458b31971/dateTargets.cmake +13 -13
  6. quasardb/date/CMakeFiles/generate.stamp.depend +4 -4
  7. quasardb/date/INSTALL.vcxproj +10 -5
  8. quasardb/date/cmake_install.cmake +6 -0
  9. quasardb/date/dateConfigVersion.cmake +0 -5
  10. quasardb/date/dateTargets.cmake +4 -8
  11. quasardb/numpy/__init__.py +58 -10
  12. quasardb/pandas/__init__.py +58 -102
  13. quasardb/pybind11/ALL_BUILD.vcxproj +10 -9
  14. quasardb/pybind11/CMakeFiles/generate.stamp.depend +14 -14
  15. quasardb/pybind11/INSTALL.vcxproj +10 -5
  16. quasardb/pybind11/cmake_install.cmake +6 -0
  17. quasardb/qdb_api.dll +0 -0
  18. quasardb/quasardb.cp312-win_amd64.pyd +0 -0
  19. quasardb/range-v3/ALL_BUILD.vcxproj +10 -9
  20. quasardb/range-v3/CMakeFiles/Export/d94ef200eca10a819b5858b33e808f5b/range-v3-targets.cmake +13 -13
  21. quasardb/range-v3/CMakeFiles/generate.stamp.depend +11 -11
  22. quasardb/range-v3/INSTALL.vcxproj +10 -5
  23. quasardb/range-v3/cmake_install.cmake +42 -0
  24. quasardb/range-v3/range-v3-config-version.cmake +0 -5
  25. quasardb/range-v3/range-v3-config.cmake +4 -8
  26. quasardb/range-v3/range.v3.headers.vcxproj +10 -9
  27. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/METADATA +15 -10
  28. quasardb-3.14.2.dev4.dist-info/RECORD +54 -0
  29. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/WHEEL +1 -1
  30. quasardb/CMakeLists.txt +0 -510
  31. quasardb/batch_column.hpp +0 -80
  32. quasardb/batch_inserter.hpp +0 -248
  33. quasardb/blob.hpp +0 -150
  34. quasardb/cluster.cpp +0 -89
  35. quasardb/cluster.hpp +0 -551
  36. quasardb/concepts.hpp +0 -278
  37. quasardb/continuous.cpp +0 -149
  38. quasardb/continuous.hpp +0 -106
  39. quasardb/convert/array.hpp +0 -282
  40. quasardb/convert/point.hpp +0 -330
  41. quasardb/convert/range.hpp +0 -282
  42. quasardb/convert/unicode.hpp +0 -598
  43. quasardb/convert/util.hpp +0 -22
  44. quasardb/convert/value.hpp +0 -711
  45. quasardb/convert.hpp +0 -38
  46. quasardb/detail/qdb_resource.hpp +0 -129
  47. quasardb/detail/ts_column.hpp +0 -224
  48. quasardb/direct_blob.hpp +0 -108
  49. quasardb/direct_handle.hpp +0 -83
  50. quasardb/direct_integer.hpp +0 -94
  51. quasardb/dispatch.hpp +0 -157
  52. quasardb/double.hpp +0 -87
  53. quasardb/entry.hpp +0 -273
  54. quasardb/error.hpp +0 -318
  55. quasardb/handle.cpp +0 -29
  56. quasardb/handle.hpp +0 -98
  57. quasardb/integer.hpp +0 -88
  58. quasardb/logger.cpp +0 -106
  59. quasardb/logger.hpp +0 -228
  60. quasardb/masked_array.hpp +0 -651
  61. quasardb/metrics.cpp +0 -103
  62. quasardb/metrics.hpp +0 -112
  63. quasardb/module.cpp +0 -76
  64. quasardb/module.hpp +0 -24
  65. quasardb/node.hpp +0 -123
  66. quasardb/numpy.cpp +0 -6
  67. quasardb/numpy.hpp +0 -489
  68. quasardb/object_tracker.hpp +0 -283
  69. quasardb/options.hpp +0 -244
  70. quasardb/perf.hpp +0 -336
  71. quasardb/pytypes.hpp +0 -221
  72. quasardb/query.cpp +0 -420
  73. quasardb/query.hpp +0 -92
  74. quasardb/reader/ts_row.hpp +0 -281
  75. quasardb/reader/ts_value.hpp +0 -245
  76. quasardb/remove_cvref.hpp +0 -31
  77. quasardb/string.hpp +0 -160
  78. quasardb/table.cpp +0 -289
  79. quasardb/table.hpp +0 -325
  80. quasardb/table_reader.hpp +0 -220
  81. quasardb/tag.hpp +0 -77
  82. quasardb/timestamp.hpp +0 -97
  83. quasardb/traits.hpp +0 -619
  84. quasardb/ts_iterator.hpp +0 -193
  85. quasardb/utils/blob_deque.hpp +0 -96
  86. quasardb/utils/ostream.hpp +0 -17
  87. quasardb/utils/permutation.hpp +0 -50
  88. quasardb/utils/stable_sort.hpp +0 -25
  89. quasardb/utils/unzip_view.hpp +0 -89
  90. quasardb/utils.cpp +0 -28
  91. quasardb/utils.hpp +0 -174
  92. quasardb/writer.cpp +0 -534
  93. quasardb/writer.hpp +0 -396
  94. quasardb-3.14.2.dev1.dist-info/RECORD +0 -118
  95. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/LICENSE.md +0 -0
  96. {quasardb-3.14.2.dev1.dist-info → quasardb-3.14.2.dev4.dist-info}/top_level.txt +0 -0
@@ -1,282 +0,0 @@
1
- /*
2
- *
3
- * Official Python API
4
- *
5
- * Copyright (c) 2009-2024, quasardb SAS. All rights reserved.
6
- * All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are met:
10
- *
11
- * * Redistributions of source code must retain the above copyright
12
- * notice, this list of conditions and the following disclaimer.
13
- * * Redistributions in binary form must reproduce the above copyright
14
- * notice, this list of conditions and the following disclaimer in the
15
- * documentation and/or other materials provided with the distribution.
16
- * * Neither the name of quasardb nor the names of its contributors may
17
- * be used to endorse or promote products derived from this software
18
- * without specific prior written permission.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY QUASARDB AND CONTRIBUTORS ``AS IS'' AND ANY
21
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
24
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
- */
31
- #pragma once
32
-
33
- #include "../concepts.hpp"
34
- #include "../error.hpp"
35
- #include "unicode.hpp"
36
- #include "util.hpp"
37
- #include <range/v3/algorithm/all_of.hpp>
38
- #include <range/v3/algorithm/copy.hpp>
39
- #include <range/v3/algorithm/find.hpp>
40
- #include <range/v3/algorithm/for_each.hpp>
41
- #include <range/v3/algorithm/max_element.hpp>
42
- #include <range/v3/range/traits.hpp>
43
- #include <range/v3/view/chunk.hpp>
44
- #include <range/v3/view/counted.hpp>
45
- #include <range/v3/view/remove_if.hpp>
46
- #include <range/v3/view/stride.hpp>
47
- #include <range/v3/view/transform.hpp>
48
-
49
- namespace qdb::convert::detail
50
- {
51
-
52
- namespace py = pybind11;
53
-
54
- template <concepts::dtype DType>
55
- requires(concepts::variable_width_dtype<DType>) struct clean_stride
56
- {
57
- using stride_type = typename DType::stride_type; // e.g. std::u32string
58
- using value_type = typename stride_type::value_type; // e.g. wchar_t
59
-
60
- static constexpr value_type const null_value_ = DType::null_value();
61
-
62
- template <concepts::input_range_t<value_type> InputRange>
63
- requires(ranges::sized_range<InputRange>) inline decltype(auto) operator()(
64
- InputRange && stride) const noexcept
65
- {
66
-
67
- auto first = ranges::begin(stride);
68
- auto last = ranges::find(stride, null_value_);
69
-
70
- using iterator_type = decltype(first);
71
- using sentinel_type = decltype(last);
72
-
73
- // There were some template deduction issues in this function for the
74
- // subrange<> call below, these static assertions are here to make this a bit
75
- // easier to deal with
76
-
77
- static_assert(ranges::input_iterator<iterator_type>);
78
- static_assert(ranges::sized_sentinel_for<sentinel_type, iterator_type>);
79
-
80
- return ranges::subrange<iterator_type, sentinel_type, ranges::subrange_kind::sized>(
81
- first, last);
82
- };
83
- };
84
-
85
- template <concepts::dtype DType>
86
- requires(concepts::fixed_width_dtype<DType>) inline decltype(auto) to_range(py::array const & xs)
87
- {
88
- // Lowest-level codepoint representation inside numpy, e.g. wchar_t for unicode
89
- // or short for int16.
90
- using value_type = typename DType::value_type;
91
- value_type const * xs_ = xs.unchecked<value_type>().data();
92
-
93
- // Numpy can sometimes use larger strides, e.g. pack int64 in a container with
94
- // 128-byte strides. In these case, we need to increase the size of our step.
95
- //
96
- // Related ticket: SC-11057
97
- py::ssize_t stride_size{0};
98
- switch (xs.ndim())
99
- {
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();
104
- break;
105
-
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);
109
- break;
110
- default:
111
- throw qdb::incompatible_type_exception{
112
- "Multi-dimensional arrays are not supported. Eexpected 0 or 1 dimensions, got: "
113
- + std::to_string(xs.ndim())};
114
- };
115
-
116
- assert(stride_size > 0);
117
-
118
- py::ssize_t item_size = xs.itemsize();
119
-
120
- // Sanity check; stride_size is number of bytes per item for a whole "step", item_size
121
- // is the number of bytes per item. As such, stride_size should always be a multiple
122
- // of item_size.
123
- assert(stride_size % item_size == 0);
124
-
125
- // The number of "steps" of <value_type> we need to take per iteration.
126
- py::ssize_t step_size = stride_size / item_size;
127
-
128
- return ranges::views::stride(ranges::views::counted(xs_, (xs.size() * step_size)), step_size);
129
- };
130
-
131
- // Variable length encoding: split into chunks of <itemsize() / codepoint_size>
132
- template <concepts::dtype DType>
133
- requires(concepts::variable_width_dtype<DType>) inline decltype(auto) to_range(py::array const & xs)
134
- {
135
- using stride_type = typename DType::stride_type;
136
- using value_type = typename stride_type::value_type;
137
-
138
- // (Note: a "code point" is a single character as defined by unicode. For
139
- // example, in UTF-16, each code point is 2 bytes).
140
- //
141
- // For numpy's variable-length encoding, numpy arrays use the following values:
142
- //
143
- // xs.size -> the total number of items
144
- // xs.itemsize -> the number of bytes of each item
145
- //
146
- // Numpy encodes, say, unicode as a single continuous range of wchar_t. For
147
- // example, given the three unicode words "yes", "no", and "wombat", the encoding
148
- // may look as follows (X -> string value, 0 -> zero padding)
149
- //
150
- // longest_word: 6 (wombat)
151
- // stride_type: u32string_t
152
- // stride_size: 4 (sizeof(stride_type::value_type))
153
- // => itemsize: 24 (longest_word * stride_size)
154
- // => size: 3 (amount of items)
155
- // => stride_size: 6 (amount of characters in longest word)
156
- //
157
- // Encoded, this will then look like this:
158
- //
159
- // [XXX000XX0000XXXXXX]
160
- // yes no wombat
161
- //
162
- // What we will do below is to convert this single, continuous range of data
163
- // to a range of strings. We do that by:
164
- //
165
- // 1. Converting the continuous numpy array to a continuous range
166
- // 2. Split this up in strides of `stride_size`; our range thus becomes
167
- // a range of subranges that all point to the start/stop of each stride
168
- // 3. Clear any null padding bytes on the right.
169
- //
170
- // A "stride" is defined as just a range, i.e. a pair of start/end iterator.
171
- //
172
- // No memory is copied, the emitted data still refers to the same numpy array
173
- // data under-the-hood.
174
- py::ssize_t stride_size = DType::stride_size(xs.itemsize());
175
-
176
- // First. let's gather a view of "all" bytes in the dataset: xs.size() repres
177
- auto all_bytes = ranges::views::counted(xs.unchecked<value_type>().data(), xs.size() * stride_size);
178
-
179
- // Now, "split" these in strides
180
- auto strides = ranges::chunk_view(all_bytes, stride_size);
181
-
182
- return ranges::views::transform(strides, clean_stride<DType>{});
183
- };
184
-
185
- /**
186
- * Converts range R to np.ndarray of dtype DType. Copies underlying data.
187
- */
188
- template <concepts::dtype DType, ranges::input_range R>
189
- requires(concepts::fixed_width_dtype<DType>) inline py::array to_array(R && xs)
190
- {
191
- using value_type = typename DType::value_type;
192
-
193
- py::ssize_t size = ranges::size(xs);
194
-
195
- py::array ret(DType::dtype(), size);
196
-
197
- ranges::copy(xs, ret.mutable_unchecked<value_type>().mutable_data());
198
-
199
- return ret;
200
- };
201
-
202
- /**
203
- * Converts range R to np.ndarray of dtype DType. Copies underlying data.
204
- */
205
- template <concepts::dtype Dtype, ranges::input_range R>
206
- requires(concepts::variable_width_dtype<Dtype>) inline py::array to_array(R && xs)
207
- {
208
- using out_char_type = typename Dtype::value_type;
209
-
210
- //
211
- // Our input range is a view of words with varying lengths, which may
212
- // have a complicated range view pipeline which does unicode conversions
213
- // and whatnot.
214
- //
215
- // In order to encode this data as a numpy contiguous, variable width
216
- // array (i.e. of dtype('U') or dtype('S')), we need to:
217
- //
218
- ////
219
- // 1. know the length of the longest word:
220
- //
221
- std::size_t stride_size = largest_word_length(xs);
222
-
223
- ////
224
- // 2. know the size (in bytes) of a single character;
225
- //
226
- py::array::StridesContainer strides{Dtype::itemsize(stride_size)};
227
-
228
- ////
229
- // 3. know the total number of words;
230
- //
231
- py::array::ShapeContainer shape{ranges::size(xs)};
232
-
233
- ////
234
- // 4. allocate a single, contiguous array of [1] * [2] * [3] bytes;
235
- //
236
- py::array arr{Dtype::dtype(stride_size), shape, strides};
237
- assert(arr.itemsize() >= 0);
238
- assert(static_cast<std::size_t>(Dtype::stride_size(arr.itemsize())) == stride_size);
239
-
240
- ////
241
- // 5. expose this contiguous array as chunks of `stride_size`
242
- //
243
- out_char_type * ptr = arr.mutable_unchecked<out_char_type>().mutable_data();
244
- auto dst =
245
- ranges::views::counted(ptr, stride_size * arr.size()) | ranges::views::chunk(stride_size);
246
- assert(ranges::size(dst) == ranges::size(xs));
247
-
248
- ////
249
- // 6. zip in and out ranges
250
- //
251
- // This will align each input stride (input range of length [0...stride_size>) next to
252
- // the output stride (output range of fixed size `stride_size`.
253
- //
254
- auto inout = ranges::zip_view(std::move(xs), std::move(dst));
255
-
256
- ////
257
- // 7. skip null values
258
- //
259
- // It's now safe to skip any null values
260
- auto inout_ = ranges::views::remove_if(
261
- std::move(inout), [](auto const & x) -> bool { return ranges::empty(std::get<0>(x)); });
262
-
263
- ////
264
- // 7. write the results into each stride.
265
- //
266
- ranges::for_each(inout_, [stride_size](auto && x) -> void {
267
- auto && [in, out] = x;
268
-
269
- static_assert(ranges::input_range<decltype(in)>);
270
- static_assert(ranges::output_range<decltype(out), out_char_type>);
271
-
272
- // assert(ranges::size(out) == stride_size);
273
- // assert(ranges::size(in) <= ranges::size(out));
274
- // assert(ranges::empty(in) == false);
275
-
276
- ranges::copy(in, ranges::begin(out));
277
- });
278
-
279
- return arr;
280
- };
281
-
282
- }; // namespace qdb::convert::detail