Skip to content

Commit

Permalink
re_query: remove polars and general dependency/features clean up (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Jan 19, 2024
1 parent dd80167 commit 16c6b6d
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 285 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion crates/re_data_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ polars-ops = { workspace = true, optional = true, features = [


[dev-dependencies]
re_log_types = { workspace = true, features = ["testing"] }
re_types = { workspace = true, features = ["datagen", "testing"] }

anyhow.workspace = true
Expand Down
1 change: 0 additions & 1 deletion crates/re_entity_db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ web-time.workspace = true

[dev-dependencies]
re_log_encoding = { workspace = true, features = ["decoder", "encoder"] }
re_log_types = { workspace = true, features = ["testing"] }
re_types = { workspace = true, features = ["datagen"] }

anyhow.workspace = true
Expand Down
2 changes: 0 additions & 2 deletions crates/re_log_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ serde = [
"re_types_core/serde",
]

testing = []

[dependencies]

# Rerun
Expand Down
1 change: 0 additions & 1 deletion crates/re_log_types/src/data_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,6 @@ impl DataTable {

/// Crafts a simple but interesting [`DataTable`].
#[cfg(not(target_arch = "wasm32"))]
#[cfg(feature = "testing")]
impl DataTable {
pub fn example(timeless: bool) -> DataTable {
use crate::{
Expand Down
1 change: 0 additions & 1 deletion crates/re_log_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub mod arrow_msg;
mod data_cell;
mod data_row;
mod data_table;
#[cfg(feature = "testing")]
pub mod example_components;
pub mod hash;
mod num_instances;
Expand Down
22 changes: 2 additions & 20 deletions crates/re_query/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ all-features = true
[features]
default = []

## Polars support
polars = ["dep:polars-core", "re_data_store/polars"]

## Enable (de)serialization using serde.
serde = ["dep:serde", "dep:rmp-serde"]

testing = ["re_log_types/testing"]

[dependencies]
# Rerun dependencies:
Expand All @@ -46,31 +39,20 @@ serde = { workspace = true, features = ["derive", "rc"], optional = true }
smallvec.workspace = true
thiserror.workspace = true

# Optional dependencies:
polars-core = { workspace = true, optional = true, features = [
"dtype-date",
"dtype-time",
"dtype-struct",
] }


[dev-dependencies]
re_types = { workspace = true, features = ["datagen"] }

criterion.workspace = true
itertools = { workspace = true }
mimalloc.workspace = true
polars-core = { workspace = true, features = [
"dtype-date",
"dtype-time",
"dtype-struct",
"fmt",
] }
rand = { workspace = true, features = ["std", "std_rng"] }


[lib]
bench = false


[[bench]]
name = "query_benchmark"
harness = false
14 changes: 14 additions & 0 deletions crates/re_query/src/archetype_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ pub struct ComponentWithInstances {
pub(crate) values: DataCell,
}

impl std::fmt::Display for ComponentWithInstances {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let table = arrow::format_table(
[
self.instance_keys.as_arrow_ref(),
self.values.as_arrow_ref(),
],
["InstanceKey", self.values.component_name().as_ref()],
);

f.write_fmt(format_args!("ComponentWithInstances:\n{table}"))
}
}

impl ComponentWithInstances {
/// Name of the [`Component`]
#[inline]
Expand Down
216 changes: 0 additions & 216 deletions crates/re_query/src/dataframe_util.rs

This file was deleted.

15 changes: 1 addition & 14 deletions crates/re_query/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
//! Provide query-centric access to the [`re_data_store`].
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
//!
// TODO(jleibs) better crate documentation.
mod archetype_view;
mod query;
mod range;
mod util;

#[cfg(feature = "polars")]
pub mod dataframe_util;

pub use self::archetype_view::{ArchetypeView, ComponentWithInstances};
pub use self::query::{get_component_with_instances, query_archetype};
pub use self::range::range_archetype;
Expand All @@ -22,7 +13,7 @@ pub use self::util::{
};

// Used for doc-tests
#[cfg(feature = "testing")]
#[doc(hidden)]
pub use self::query::__populate_example_store;

#[derive(Debug, Clone, Copy)]
Expand Down Expand Up @@ -65,10 +56,6 @@ pub enum QueryError {
#[error("Error converting arrow data: {0}")]
ArrowError(#[from] arrow2::error::Error),

#[cfg(feature = "polars")]
#[error("Error from within Polars")]
PolarsError(#[from] polars_core::prelude::PolarsError),

#[error("Not implemented")]
NotImplemented,
}
Expand Down
Loading

0 comments on commit 16c6b6d

Please sign in to comment.