Skip to content

Commit c241f59

Browse files
chore: apply imports_granularity = "Item" everywhere expect bench-vortex (#5521)
requires some non-auto changes to to `bench-vortex` --------- Signed-off-by: Joe Isaacs <[email protected]>
1 parent d839973 commit c241f59

File tree

1,048 files changed

+12224
-4847
lines changed

Some content is hidden

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

1,048 files changed

+12224
-4847
lines changed

bench-vortex/rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
imports_granularity = "Module"
1+
imports_granularity = "Module"

encodings/alp/benches/alp_compress.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
#![allow(clippy::unwrap_used)]
55

66
use divan::Bencher;
7+
use rand::Rng;
8+
use rand::SeedableRng as _;
79
use rand::rngs::StdRng;
8-
use rand::{Rng, SeedableRng as _};
9-
use vortex_alp::{ALPFloat, ALPRDFloat, RDEncoder, alp_encode, decompress};
10+
use vortex_alp::ALPFloat;
11+
use vortex_alp::ALPRDFloat;
12+
use vortex_alp::RDEncoder;
13+
use vortex_alp::alp_encode;
14+
use vortex_alp::decompress;
1015
use vortex_array::arrays::PrimitiveArray;
1116
use vortex_array::compute::warm_up_vtables;
1217
use vortex_array::validity::Validity;
13-
use vortex_buffer::{Buffer, buffer};
18+
use vortex_buffer::Buffer;
19+
use vortex_buffer::buffer;
1420
use vortex_dtype::NativePType;
1521

1622
fn main() {

encodings/alp/rustfmt.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

encodings/alp/src/alp/array.rs

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,47 @@
44
use std::fmt::Debug;
55
use std::hash::Hash;
66

7-
use vortex_array::patches::{Patches, PatchesMetadata};
7+
use vortex_array::Array;
8+
use vortex_array::ArrayBufferVisitor;
9+
use vortex_array::ArrayChildVisitor;
10+
use vortex_array::ArrayEq;
11+
use vortex_array::ArrayHash;
12+
use vortex_array::ArrayRef;
13+
use vortex_array::Canonical;
14+
use vortex_array::DeserializeMetadata;
15+
use vortex_array::Precision;
16+
use vortex_array::ProstMetadata;
17+
use vortex_array::SerializeMetadata;
18+
use vortex_array::patches::Patches;
19+
use vortex_array::patches::PatchesMetadata;
820
use vortex_array::serde::ArrayChildren;
9-
use vortex_array::stats::{ArrayStats, StatsSetRef};
10-
use vortex_array::vtable::{
11-
ArrayId, ArrayVTable, ArrayVTableExt, BaseArrayVTable, CanonicalVTable, EncodeVTable,
12-
NotSupported, VTable, ValidityChild, ValidityVTableFromChild, VisitorVTable,
13-
};
14-
use vortex_array::{
15-
Array, ArrayBufferVisitor, ArrayChildVisitor, ArrayEq, ArrayHash, ArrayRef, Canonical,
16-
DeserializeMetadata, Precision, ProstMetadata, SerializeMetadata, vtable,
17-
};
21+
use vortex_array::stats::ArrayStats;
22+
use vortex_array::stats::StatsSetRef;
23+
use vortex_array::vtable;
24+
use vortex_array::vtable::ArrayId;
25+
use vortex_array::vtable::ArrayVTable;
26+
use vortex_array::vtable::ArrayVTableExt;
27+
use vortex_array::vtable::BaseArrayVTable;
28+
use vortex_array::vtable::CanonicalVTable;
29+
use vortex_array::vtable::EncodeVTable;
30+
use vortex_array::vtable::NotSupported;
31+
use vortex_array::vtable::VTable;
32+
use vortex_array::vtable::ValidityChild;
33+
use vortex_array::vtable::ValidityVTableFromChild;
34+
use vortex_array::vtable::VisitorVTable;
1835
use vortex_buffer::ByteBuffer;
19-
use vortex_dtype::{DType, PType};
20-
use vortex_error::{VortexError, VortexExpect, VortexResult, vortex_bail, vortex_ensure};
36+
use vortex_dtype::DType;
37+
use vortex_dtype::PType;
38+
use vortex_error::VortexError;
39+
use vortex_error::VortexExpect;
40+
use vortex_error::VortexResult;
41+
use vortex_error::vortex_bail;
42+
use vortex_error::vortex_ensure;
2143

2244
use crate::ALPFloat;
23-
use crate::alp::{Exponents, alp_encode, decompress};
45+
use crate::alp::Exponents;
46+
use crate::alp::alp_encode;
47+
use crate::alp::decompress;
2448

2549
vtable!(ALP);
2650

encodings/alp/src/alp/compress.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,25 @@ use std::mem::transmute;
55

66
use itertools::Itertools;
77
use num_traits::AsPrimitive;
8-
use vortex_array::arrays::{PrimitiveArray, patch_chunk};
8+
use vortex_array::ArrayRef;
9+
use vortex_array::IntoArray;
10+
use vortex_array::ToCanonical;
11+
use vortex_array::arrays::PrimitiveArray;
12+
use vortex_array::arrays::patch_chunk;
913
use vortex_array::patches::Patches;
1014
use vortex_array::validity::Validity;
1115
use vortex_array::vtable::ValidityHelper;
12-
use vortex_array::{ArrayRef, IntoArray, ToCanonical};
13-
use vortex_buffer::{Buffer, BufferMut};
14-
use vortex_dtype::{PType, match_each_unsigned_integer_ptype};
15-
use vortex_error::{VortexResult, vortex_bail};
16+
use vortex_buffer::Buffer;
17+
use vortex_buffer::BufferMut;
18+
use vortex_dtype::PType;
19+
use vortex_dtype::match_each_unsigned_integer_ptype;
20+
use vortex_error::VortexResult;
21+
use vortex_error::vortex_bail;
1622
use vortex_mask::Mask;
1723

1824
use crate::Exponents;
19-
use crate::alp::{ALPArray, ALPFloat};
25+
use crate::alp::ALPArray;
26+
use crate::alp::ALPFloat;
2027

2128
#[macro_export]
2229
macro_rules! match_each_alp_float_ptype {
@@ -246,10 +253,12 @@ fn decompress_unchunked(array: ALPArray) -> PrimitiveArray {
246253
mod tests {
247254
use core::f64;
248255

249-
use f64::consts::{E, PI};
256+
use f64::consts::E;
257+
use f64::consts::PI;
250258
use vortex_array::assert_arrays_eq;
251259
use vortex_array::validity::Validity;
252-
use vortex_buffer::{Buffer, buffer};
260+
use vortex_buffer::Buffer;
261+
use vortex_buffer::buffer;
253262
use vortex_dtype::NativePType;
254263

255264
use super::*;

encodings/alp/src/alp/compute/between.rs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,25 @@
33

44
use std::fmt::Debug;
55

6+
use vortex_array::Array;
7+
use vortex_array::ArrayRef;
68
use vortex_array::arrays::ConstantArray;
7-
use vortex_array::compute::{
8-
BetweenKernel, BetweenKernelAdapter, BetweenOptions, StrictComparison, between,
9-
};
10-
use vortex_array::{Array, ArrayRef, register_kernel};
11-
use vortex_dtype::{NativeDType, NativePType, Nullability};
9+
use vortex_array::compute::BetweenKernel;
10+
use vortex_array::compute::BetweenKernelAdapter;
11+
use vortex_array::compute::BetweenOptions;
12+
use vortex_array::compute::StrictComparison;
13+
use vortex_array::compute::between;
14+
use vortex_array::register_kernel;
15+
use vortex_dtype::NativeDType;
16+
use vortex_dtype::NativePType;
17+
use vortex_dtype::Nullability;
1218
use vortex_error::VortexResult;
1319
use vortex_scalar::Scalar;
1420

15-
use crate::{ALPArray, ALPFloat, ALPVTable, match_each_alp_float_ptype};
21+
use crate::ALPArray;
22+
use crate::ALPFloat;
23+
use crate::ALPVTable;
24+
use crate::match_each_alp_float_ptype;
1625

1726
impl BetweenKernel for ALPVTable {
1827
fn between(
@@ -94,11 +103,13 @@ mod tests {
94103
use itertools::Itertools;
95104
use vortex_array::ToCanonical;
96105
use vortex_array::arrays::PrimitiveArray;
97-
use vortex_array::compute::{BetweenOptions, StrictComparison};
106+
use vortex_array::compute::BetweenOptions;
107+
use vortex_array::compute::StrictComparison;
98108
use vortex_dtype::Nullability;
99109

110+
use crate::ALPArray;
100111
use crate::alp::compute::between::between_impl;
101-
use crate::{ALPArray, alp_encode};
112+
use crate::alp_encode;
102113

103114
fn between_test(arr: &ALPArray, lower: f32, upper: f32, options: &BetweenOptions) -> bool {
104115
let res = between_impl(arr, lower, upper, Nullability::Nullable, options)

encodings/alp/src/alp/compute/cast.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use vortex_array::compute::{CastKernel, CastKernelAdapter, cast};
5-
use vortex_array::{ArrayRef, IntoArray, register_kernel};
4+
use vortex_array::ArrayRef;
5+
use vortex_array::IntoArray;
6+
use vortex_array::compute::CastKernel;
7+
use vortex_array::compute::CastKernelAdapter;
8+
use vortex_array::compute::cast;
9+
use vortex_array::register_kernel;
610
use vortex_dtype::DType;
711
use vortex_error::VortexResult;
812

9-
use crate::alp::{ALPArray, ALPVTable};
13+
use crate::alp::ALPArray;
14+
use crate::alp::ALPVTable;
1015

1116
impl CastKernel for ALPVTable {
1217
fn cast(&self, array: &ALPArray, dtype: &DType) -> VortexResult<Option<ArrayRef>> {
@@ -45,13 +50,16 @@ register_kernel!(CastKernelAdapter(ALPVTable).lift());
4550
#[cfg(test)]
4651
mod tests {
4752
use rstest::rstest;
53+
use vortex_array::IntoArray;
4854
use vortex_array::arrays::PrimitiveArray;
55+
use vortex_array::assert_arrays_eq;
4956
use vortex_array::compute::cast;
5057
use vortex_array::compute::conformance::cast::test_cast_conformance;
5158
use vortex_array::vtable::ArrayVTableExt;
52-
use vortex_array::{IntoArray, assert_arrays_eq};
5359
use vortex_buffer::buffer;
54-
use vortex_dtype::{DType, Nullability, PType};
60+
use vortex_dtype::DType;
61+
use vortex_dtype::Nullability;
62+
use vortex_dtype::PType;
5563

5664
use crate::ALPVTable;
5765

encodings/alp/src/alp/compute/compare.rs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,25 @@
33

44
use std::fmt::Debug;
55

6+
use vortex_array::Array;
7+
use vortex_array::ArrayRef;
8+
use vortex_array::IntoArray;
69
use vortex_array::arrays::ConstantArray;
7-
use vortex_array::compute::{CompareKernel, CompareKernelAdapter, Operator, compare};
8-
use vortex_array::{Array, ArrayRef, IntoArray, register_kernel};
10+
use vortex_array::compute::CompareKernel;
11+
use vortex_array::compute::CompareKernelAdapter;
12+
use vortex_array::compute::Operator;
13+
use vortex_array::compute::compare;
14+
use vortex_array::register_kernel;
915
use vortex_dtype::NativePType;
10-
use vortex_error::{VortexResult, vortex_bail};
11-
use vortex_scalar::{PrimitiveScalar, Scalar};
16+
use vortex_error::VortexResult;
17+
use vortex_error::vortex_bail;
18+
use vortex_scalar::PrimitiveScalar;
19+
use vortex_scalar::Scalar;
1220

13-
use crate::{ALPArray, ALPFloat, ALPVTable, match_each_alp_float_ptype};
21+
use crate::ALPArray;
22+
use crate::ALPFloat;
23+
use crate::ALPVTable;
24+
use crate::match_each_alp_float_ptype;
1425

1526
// TODO(joe): add fuzzing.
1627

@@ -129,9 +140,13 @@ where
129140
mod tests {
130141
use rstest::rstest;
131142
use vortex_array::ToCanonical;
132-
use vortex_array::arrays::{ConstantArray, PrimitiveArray};
133-
use vortex_array::compute::{Operator, compare};
134-
use vortex_dtype::{DType, Nullability, PType};
143+
use vortex_array::arrays::ConstantArray;
144+
use vortex_array::arrays::PrimitiveArray;
145+
use vortex_array::compute::Operator;
146+
use vortex_array::compute::compare;
147+
use vortex_dtype::DType;
148+
use vortex_dtype::Nullability;
149+
use vortex_dtype::PType;
135150
use vortex_scalar::Scalar;
136151

137152
use super::*;

encodings/alp/src/alp/compute/filter.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use vortex_array::compute::{FilterKernel, FilterKernelAdapter, filter};
5-
use vortex_array::{ArrayRef, register_kernel};
4+
use vortex_array::ArrayRef;
5+
use vortex_array::compute::FilterKernel;
6+
use vortex_array::compute::FilterKernelAdapter;
7+
use vortex_array::compute::filter;
8+
use vortex_array::register_kernel;
69
use vortex_error::VortexResult;
710
use vortex_mask::Mask;
811

9-
use crate::{ALPArray, ALPVTable};
12+
use crate::ALPArray;
13+
use crate::ALPVTable;
1014

1115
impl FilterKernel for ALPVTable {
1216
fn filter(&self, array: &ALPArray, mask: &Mask) -> VortexResult<ArrayRef> {
@@ -34,10 +38,11 @@ register_kernel!(FilterKernelAdapter(ALPVTable).lift());
3438
#[cfg(test)]
3539
mod test {
3640
use rstest::rstest;
41+
use vortex_array::ArrayRef;
42+
use vortex_array::IntoArray;
3743
use vortex_array::arrays::PrimitiveArray;
3844
use vortex_array::compute::conformance::filter::test_filter_conformance;
3945
use vortex_array::vtable::ArrayVTableExt;
40-
use vortex_array::{ArrayRef, IntoArray};
4146
use vortex_buffer::buffer;
4247

4348
use crate::ALPVTable;

encodings/alp/src/alp/compute/mask.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use vortex_array::compute::{MaskKernel, MaskKernelAdapter, mask};
5-
use vortex_array::{ArrayRef, register_kernel};
4+
use vortex_array::ArrayRef;
5+
use vortex_array::compute::MaskKernel;
6+
use vortex_array::compute::MaskKernelAdapter;
7+
use vortex_array::compute::mask;
8+
use vortex_array::register_kernel;
69
use vortex_error::VortexResult;
710
use vortex_mask::Mask;
811

9-
use crate::{ALPArray, ALPVTable};
12+
use crate::ALPArray;
13+
use crate::ALPVTable;
1014

1115
impl MaskKernel for ALPVTable {
1216
fn mask(&self, array: &ALPArray, filter_mask: &Mask) -> VortexResult<ArrayRef> {

0 commit comments

Comments
 (0)