Available on crate feature
data only.Expand description
The typed, lazy data model shared by tables, viewers, and plots.
A Dataset is columnar: floats, integers, booleans, text, dates, times, and
categories, with a validity mask and per-column units/metadata. A DataSource adds
paging, change notification, and cancellation without an async runtime. The query
language filters rows, the CSV connector opens delimited files, and the ring and
channel sources cover streaming data.
use crisol_core::data::{Column, Dataset, Query};
let data = Dataset::from_columns([
Column::floats("voltage", vec![0.1, 0.4, 0.2]),
Column::ints("cycle", vec![1, 2, 3]),
]);
let query = Query::parse("voltage > 0.15").expect("query");
assert_eq!(query.matching_rows(&data), [1, 2]);Re-exports§
pub use scientific::read_hdf5;hdf5pub use scientific::read_netcdf;netcdfpub use scientific::read_zarr;zarr
Modules§
- conformance
conformance - The implementation-independent conformance suite for data backends (SWAP-04).
- polars
polars - Polars DataFrame backend, validated by the conformance suite.
- scientific
hdf5ornetcdforzarr - Scientific container readers: HDF5, NetCDF, and Zarr.
Structs§
- Arrow
Source - An Arrow IPC file exposed as a paged data source.
- Bound
Query - A query with column names resolved to indices.
- Bounds
- An axis-aligned range in data space.
- Channel
Source - A source whose current dataset can be replaced by a channel message.
- Column
- One column with its name, type, validity, and metadata.
- Column
Schema - The schema of one column, without its values.
- Column
Stats - Summary statistics of one numeric column.
- CsvOptions
- CSV options.
- CsvSource
- A parsed CSV/TSV source.
- Dataset
- A typed table: columns of equal length with dataset metadata.
- Dataset
Diff - The differences between two datasets.
- Lineage
- The ordered history of a dataset.
- Lineage
Step - One transformation applied to a dataset.
- LinkHub
- The selection bus for one dataset.
- Link
Selection - One selection in a dataset.
- LodTile
- One block of a level: its x span and the y minimum/maximum in that span.
- Memory
Source - A source backed by an in-memory dataset.
- MinMax
Pyramid - A min/max pyramid over a paged source. Levels are built on first use and blocks are cached, so a plot asks only for the tiles its viewport needs.
- Parquet
Source - A Parquet file exposed as a paged data source.
- Query
- A parsed filter expression.
- Query
Error - What went wrong while parsing or evaluating a query.
- Query
Plan - A filter expression plus the columns a backend should read for it.
- Ring
Buffer - A ring of the newest rows with a fixed schema.
- Sqlite
Source - A SQLite query exposed as a paged data source.
- Streaming
Series - A bounded, append-only (x, y) series for live data.
- Trigger
- A level crossing that fires once per edge.
- Unit
- A linear unit:
base = value * scale + offset. - Workbook
Source - One workbook with a dataset per sheet.
Enums§
- Cell
Value - A borrowed cell value.
- Column
Type - The type of one column.
- Column
Values - The storage of one column. Strings are shared with
Arc<[String]>, so a clone is cheap and a derived column can keep the same backing storage. - Data
Error - Why a data source could not read.
- Data
Value - An owned value, used by the query evaluator and streaming buffers.
- Join
Kind - How a join treats rows without a match.
- Link
Mode - How linked views react to a selection.
- Stream
Mode - Whether a streaming series accepts new points.
- Unit
Error - Why a column cannot be converted.
- Validation
Issue - One failed validation.
- Validation
Rule - A rule checked by
validate. - Window
Function - A computed column over one value series.
Constants§
- MAX_
FILE_ BYTES - Largest file a connector or the viewer reads into memory.
Traits§
- Data
Source - A lazy, paged table. A source can be backed by a file, a database, a channel, or a thread; the trait is synchronous and never pulls in an async runtime.
Functions§
- convert_
unit - Convert
valuefrom one unit to another. - dataset_
from_ batch - Convert an Arrow record batch into a typed dataset.
- dataset_
to_ batch - Convert a dataset into an Arrow record batch (zero-copy for the column buffers when the dataset was built from Arrow).
- diff
- Compare two datasets by schema and cell values.
- join
- Join two datasets on two columns. Right columns that collide with a left name get a
_rightsuffix. - parse_
csv - Parse bytes as a delimited table, inferring int, float, bool, and text columns.
- parse_
unit - Look up a unit by symbol.
- plan
- Build a pushdown plan: the backend reads only
columns, then applies the filter. - read_
arrow_ ipc - Read an Arrow IPC file (the
.arrow/.featherfile format) into a dataset. - read_
limited - Read a file, refusing one larger than
MAX_FILE_BYTES. - read_
parquet_ bytes - Read Parquet bytes into a dataset.
- read_
sqlite - Run a query and convert every row to a dataset.
- validate
- Check
rulesagainstdata. - window
- Compute a window function over
values. - window_
column - A window result as a column.
- write_
arrow_ ipc - Write a dataset as an Arrow IPC file.