Skip to content

Commit bf97ba2

Browse files
authored
Array VTables Follow Up (#7276)
This PR follows #7215 --------- Signed-off-by: Nicholas Gates <nick@nickgates.com>
1 parent a8351a9 commit bf97ba2

File tree

288 files changed

+5625
-7585
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+5625
-7585
lines changed

docs/api/python/arrays.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Registry and Serde
144144
.. autoclass:: vortex.ArrayContext
145145
:members:
146146

147-
.. autoclass:: vortex.ArrayParts
147+
.. autoclass:: vortex.SerializedArray
148148
:members:
149149

150150

encodings/alp/public-api.lock

Lines changed: 25 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl vortex_alp::ALP
1212

1313
pub fn vortex_alp::ALP::new(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_alp::ALPArray
1414

15-
pub unsafe fn vortex_alp::ALP::new_unchecked(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>, dtype: vortex_array::dtype::DType) -> vortex_alp::ALPArray
15+
pub unsafe fn vortex_alp::ALP::new_unchecked(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_alp::ALPArray
1616

1717
pub fn vortex_alp::ALP::try_new(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>) -> vortex_error::VortexResult<vortex_alp::ALPArray>
1818

@@ -28,8 +28,6 @@ impl vortex_array::array::vtable::VTable for vortex_alp::ALP
2828

2929
pub type vortex_alp::ALP::ArrayData = vortex_alp::ALPData
3030

31-
pub type vortex_alp::ALP::Metadata = vortex_array::metadata::ProstMetadata<vortex_alp::ALPMetadata>
32-
3331
pub type vortex_alp::ALP::OperationsVTable = vortex_alp::ALP
3432

3533
pub type vortex_alp::ALP::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
@@ -42,35 +40,25 @@ pub fn vortex_alp::ALP::buffer(_array: vortex_array::array::view::ArrayView<'_,
4240

4341
pub fn vortex_alp::ALP::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option<alloc::string::String>
4442

45-
pub fn vortex_alp::ALP::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult<vortex_alp::ALPData>
46-
47-
pub fn vortex_alp::ALP::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Metadata>
48-
49-
pub fn vortex_alp::ALP::dtype(array: &vortex_alp::ALPData) -> &vortex_array::dtype::DType
43+
pub fn vortex_alp::ALP::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<vortex_alp::ALPData>
5044

5145
pub fn vortex_alp::ALP::execute(array: vortex_array::array::typed::Array<Self>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::executor::ExecutionResult>
5246

5347
pub fn vortex_alp::ALP::execute_parent(array: vortex_array::array::view::ArrayView<'_, Self>, parent: &vortex_array::array::erased::ArrayRef, child_idx: usize, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
5448

5549
pub fn vortex_alp::ALP::id(&self) -> vortex_array::array::ArrayId
5650

57-
pub fn vortex_alp::ALP::len(array: &vortex_alp::ALPData) -> usize
58-
59-
pub fn vortex_alp::ALP::metadata(array: vortex_array::array::view::ArrayView<'_, Self>) -> vortex_error::VortexResult<Self::Metadata>
60-
6151
pub fn vortex_alp::ALP::nbuffers(_array: vortex_array::array::view::ArrayView<'_, Self>) -> usize
6252

6353
pub fn vortex_alp::ALP::reduce_parent(array: vortex_array::array::view::ArrayView<'_, Self>, parent: &vortex_array::array::erased::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
6454

65-
pub fn vortex_alp::ALP::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
55+
pub fn vortex_alp::ALP::serialize(array: vortex_array::array::view::ArrayView<'_, Self>) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
6656

6757
pub fn vortex_alp::ALP::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String
6858

6959
pub fn vortex_alp::ALP::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option<vortex_array::array::erased::ArrayRef>]
7060

71-
pub fn vortex_alp::ALP::stats(array: &vortex_alp::ALPData) -> &vortex_array::stats::array::ArrayStats
72-
73-
pub fn vortex_alp::ALP::vtable(_array: &Self::ArrayData) -> &Self
61+
pub fn vortex_alp::ALP::validate(&self, data: &vortex_alp::ALPData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()>
7462

7563
pub fn vortex_alp::ALP::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>) -> vortex_error::VortexResult<()>
7664

@@ -118,22 +106,14 @@ pub struct vortex_alp::ALPData
118106

119107
impl vortex_alp::ALPData
120108

121-
pub fn vortex_alp::ALPData::dtype(&self) -> &vortex_array::dtype::DType
122-
123109
pub fn vortex_alp::ALPData::encoded(&self) -> &vortex_array::array::erased::ArrayRef
124110

125111
pub fn vortex_alp::ALPData::exponents(&self) -> vortex_alp::Exponents
126112

127-
pub fn vortex_alp::ALPData::into_parts(self) -> (vortex_array::array::erased::ArrayRef, vortex_alp::Exponents, core::option::Option<vortex_array::patches::Patches>, vortex_array::dtype::DType)
128-
129-
pub fn vortex_alp::ALPData::is_empty(&self) -> bool
130-
131-
pub fn vortex_alp::ALPData::len(&self) -> usize
113+
pub fn vortex_alp::ALPData::into_parts(self) -> (vortex_array::array::erased::ArrayRef, vortex_alp::Exponents, core::option::Option<vortex_array::patches::Patches>)
132114

133115
pub fn vortex_alp::ALPData::patches(&self) -> core::option::Option<vortex_array::patches::Patches>
134116

135-
pub fn vortex_alp::ALPData::ptype(&self) -> vortex_array::dtype::ptype::PType
136-
137117
impl vortex_alp::ALPData
138118

139119
pub fn vortex_alp::ALPData::new(encoded: vortex_array::array::erased::ArrayRef, exponents: vortex_alp::Exponents, patches: core::option::Option<vortex_array::patches::Patches>) -> Self
@@ -144,18 +124,10 @@ impl core::clone::Clone for vortex_alp::ALPData
144124

145125
pub fn vortex_alp::ALPData::clone(&self) -> vortex_alp::ALPData
146126

147-
impl core::convert::From<vortex_alp::ALPData> for vortex_array::array::erased::ArrayRef
148-
149-
pub fn vortex_array::array::erased::ArrayRef::from(value: vortex_alp::ALPData) -> vortex_array::array::erased::ArrayRef
150-
151127
impl core::fmt::Debug for vortex_alp::ALPData
152128

153129
pub fn vortex_alp::ALPData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
154130

155-
impl vortex_array::array::IntoArray for vortex_alp::ALPData
156-
157-
pub fn vortex_alp::ALPData::into_array(self) -> vortex_array::array::erased::ArrayRef
158-
159131
pub struct vortex_alp::ALPMetadata
160132

161133
impl core::clone::Clone for vortex_alp::ALPMetadata
@@ -198,8 +170,6 @@ impl vortex_array::array::vtable::VTable for vortex_alp::ALPRD
198170

199171
pub type vortex_alp::ALPRD::ArrayData = vortex_alp::ALPRDData
200172

201-
pub type vortex_alp::ALPRD::Metadata = vortex_array::metadata::ProstMetadata<vortex_alp::ALPRDMetadata>
202-
203173
pub type vortex_alp::ALPRD::OperationsVTable = vortex_alp::ALPRD
204174

205175
pub type vortex_alp::ALPRD::ValidityVTable = vortex_array::array::vtable::validity::ValidityVTableFromChild
@@ -212,35 +182,25 @@ pub fn vortex_alp::ALPRD::buffer(_array: vortex_array::array::view::ArrayView<'_
212182

213183
pub fn vortex_alp::ALPRD::buffer_name(_array: vortex_array::array::view::ArrayView<'_, Self>, _idx: usize) -> core::option::Option<alloc::string::String>
214184

215-
pub fn vortex_alp::ALPRD::build(dtype: &vortex_array::dtype::DType, len: usize, metadata: &Self::Metadata, _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren) -> vortex_error::VortexResult<vortex_alp::ALPRDData>
216-
217-
pub fn vortex_alp::ALPRD::deserialize(bytes: &[u8], _dtype: &vortex_array::dtype::DType, _len: usize, _buffers: &[vortex_array::buffer::BufferHandle], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Metadata>
218-
219-
pub fn vortex_alp::ALPRD::dtype(array: &vortex_alp::ALPRDData) -> &vortex_array::dtype::DType
185+
pub fn vortex_alp::ALPRD::deserialize(&self, dtype: &vortex_array::dtype::DType, len: usize, metadata: &[u8], _buffers: &[vortex_array::buffer::BufferHandle], children: &dyn vortex_array::serde::ArrayChildren, _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<vortex_alp::ALPRDData>
220186

221187
pub fn vortex_alp::ALPRD::execute(array: vortex_array::array::typed::Array<Self>, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::executor::ExecutionResult>
222188

223189
pub fn vortex_alp::ALPRD::execute_parent(array: vortex_array::array::view::ArrayView<'_, Self>, parent: &vortex_array::array::erased::ArrayRef, child_idx: usize, ctx: &mut vortex_array::executor::ExecutionCtx) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
224190

225191
pub fn vortex_alp::ALPRD::id(&self) -> vortex_array::array::ArrayId
226192

227-
pub fn vortex_alp::ALPRD::len(array: &vortex_alp::ALPRDData) -> usize
228-
229-
pub fn vortex_alp::ALPRD::metadata(array: vortex_array::array::view::ArrayView<'_, Self>) -> vortex_error::VortexResult<Self::Metadata>
230-
231193
pub fn vortex_alp::ALPRD::nbuffers(_array: vortex_array::array::view::ArrayView<'_, Self>) -> usize
232194

233195
pub fn vortex_alp::ALPRD::reduce_parent(array: vortex_array::array::view::ArrayView<'_, Self>, parent: &vortex_array::array::erased::ArrayRef, child_idx: usize) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
234196

235-
pub fn vortex_alp::ALPRD::serialize(metadata: Self::Metadata) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
197+
pub fn vortex_alp::ALPRD::serialize(array: vortex_array::array::view::ArrayView<'_, Self>) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>
236198

237199
pub fn vortex_alp::ALPRD::slot_name(_array: vortex_array::array::view::ArrayView<'_, Self>, idx: usize) -> alloc::string::String
238200

239201
pub fn vortex_alp::ALPRD::slots(array: vortex_array::array::view::ArrayView<'_, Self>) -> &[core::option::Option<vortex_array::array::erased::ArrayRef>]
240202

241-
pub fn vortex_alp::ALPRD::stats(array: &vortex_alp::ALPRDData) -> &vortex_array::stats::array::ArrayStats
242-
243-
pub fn vortex_alp::ALPRD::vtable(_array: &Self::ArrayData) -> &Self
203+
pub fn vortex_alp::ALPRD::validate(&self, data: &vortex_alp::ALPRDData, dtype: &vortex_array::dtype::DType, len: usize) -> vortex_error::VortexResult<()>
244204

245205
pub fn vortex_alp::ALPRD::with_slots(array: &mut Self::ArrayData, slots: alloc::vec::Vec<core::option::Option<vortex_array::array::erased::ArrayRef>>) -> vortex_error::VortexResult<()>
246206

@@ -272,46 +232,18 @@ impl vortex_array::scalar_fn::fns::mask::kernel::MaskReduce for vortex_alp::ALPR
272232

273233
pub fn vortex_alp::ALPRD::mask(array: vortex_array::array::view::ArrayView<'_, Self>, mask: &vortex_array::array::erased::ArrayRef) -> vortex_error::VortexResult<core::option::Option<vortex_array::array::erased::ArrayRef>>
274234

275-
pub struct vortex_alp::ALPRDArrayParts
276-
277-
pub vortex_alp::ALPRDArrayParts::dtype: vortex_array::dtype::DType
278-
279-
pub vortex_alp::ALPRDArrayParts::left_parts: vortex_array::array::erased::ArrayRef
280-
281-
pub vortex_alp::ALPRDArrayParts::left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>
282-
283-
pub vortex_alp::ALPRDArrayParts::left_parts_patches: core::option::Option<vortex_array::patches::Patches>
284-
285-
pub vortex_alp::ALPRDArrayParts::right_parts: vortex_array::array::erased::ArrayRef
286-
287-
impl core::clone::Clone for vortex_alp::ALPRDArrayParts
288-
289-
pub fn vortex_alp::ALPRDArrayParts::clone(&self) -> vortex_alp::ALPRDArrayParts
290-
291-
impl core::fmt::Debug for vortex_alp::ALPRDArrayParts
292-
293-
pub fn vortex_alp::ALPRDArrayParts::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
294-
295235
pub struct vortex_alp::ALPRDData
296236

297237
impl vortex_alp::ALPRDData
298238

299-
pub fn vortex_alp::ALPRDData::dtype(&self) -> &vortex_array::dtype::DType
300-
301-
pub fn vortex_alp::ALPRDData::into_parts(self) -> vortex_alp::ALPRDArrayParts
302-
303-
pub fn vortex_alp::ALPRDData::is_empty(&self) -> bool
304-
305-
pub fn vortex_alp::ALPRDData::is_f32(&self) -> bool
239+
pub fn vortex_alp::ALPRDData::into_parts(self) -> vortex_alp::ALPRDDataParts
306240

307241
pub fn vortex_alp::ALPRDData::left_parts(&self) -> &vortex_array::array::erased::ArrayRef
308242

309243
pub fn vortex_alp::ALPRDData::left_parts_dictionary(&self) -> &vortex_buffer::buffer::Buffer<u16>
310244

311245
pub fn vortex_alp::ALPRDData::left_parts_patches(&self) -> core::option::Option<vortex_array::patches::Patches>
312246

313-
pub fn vortex_alp::ALPRDData::len(&self) -> usize
314-
315247
pub fn vortex_alp::ALPRDData::replace_left_parts_patches(&mut self, patches: core::option::Option<vortex_array::patches::Patches>)
316248

317249
pub fn vortex_alp::ALPRDData::right_bit_width(&self) -> u8
@@ -324,17 +256,27 @@ impl core::clone::Clone for vortex_alp::ALPRDData
324256

325257
pub fn vortex_alp::ALPRDData::clone(&self) -> vortex_alp::ALPRDData
326258

327-
impl core::convert::From<vortex_alp::ALPRDData> for vortex_array::array::erased::ArrayRef
328-
329-
pub fn vortex_array::array::erased::ArrayRef::from(value: vortex_alp::ALPRDData) -> vortex_array::array::erased::ArrayRef
330-
331259
impl core::fmt::Debug for vortex_alp::ALPRDData
332260

333261
pub fn vortex_alp::ALPRDData::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
334262

335-
impl vortex_array::array::IntoArray for vortex_alp::ALPRDData
263+
pub struct vortex_alp::ALPRDDataParts
264+
265+
pub vortex_alp::ALPRDDataParts::left_parts: vortex_array::array::erased::ArrayRef
266+
267+
pub vortex_alp::ALPRDDataParts::left_parts_dictionary: vortex_buffer::buffer::Buffer<u16>
268+
269+
pub vortex_alp::ALPRDDataParts::left_parts_patches: core::option::Option<vortex_array::patches::Patches>
270+
271+
pub vortex_alp::ALPRDDataParts::right_parts: vortex_array::array::erased::ArrayRef
272+
273+
impl core::clone::Clone for vortex_alp::ALPRDDataParts
274+
275+
pub fn vortex_alp::ALPRDDataParts::clone(&self) -> vortex_alp::ALPRDDataParts
276+
277+
impl core::fmt::Debug for vortex_alp::ALPRDDataParts
336278

337-
pub fn vortex_alp::ALPRDData::into_array(self) -> vortex_array::array::erased::ArrayRef
279+
pub fn vortex_alp::ALPRDDataParts::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result
338280

339281
pub struct vortex_alp::ALPRDMetadata
340282

0 commit comments

Comments
 (0)