Skip to main content

Module data

Module data 

Source
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;hdf5
pub use scientific::read_netcdf;netcdf
pub use scientific::read_zarr;zarr

Modules§

conformanceconformance
The implementation-independent conformance suite for data backends (SWAP-04).
polarspolars
Polars DataFrame backend, validated by the conformance suite.
scientifichdf5 or netcdf or zarr
Scientific container readers: HDF5, NetCDF, and Zarr.

Structs§

ArrowSource
An Arrow IPC file exposed as a paged data source.
BoundQuery
A query with column names resolved to indices.
Bounds
An axis-aligned range in data space.
ChannelSource
A source whose current dataset can be replaced by a channel message.
Column
One column with its name, type, validity, and metadata.
ColumnSchema
The schema of one column, without its values.
ColumnStats
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.
DatasetDiff
The differences between two datasets.
Lineage
The ordered history of a dataset.
LineageStep
One transformation applied to a dataset.
LinkHub
The selection bus for one dataset.
LinkSelection
One selection in a dataset.
LodTile
One block of a level: its x span and the y minimum/maximum in that span.
MemorySource
A source backed by an in-memory dataset.
MinMaxPyramid
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.
ParquetSource
A Parquet file exposed as a paged data source.
Query
A parsed filter expression.
QueryError
What went wrong while parsing or evaluating a query.
QueryPlan
A filter expression plus the columns a backend should read for it.
RingBuffer
A ring of the newest rows with a fixed schema.
SqliteSource
A SQLite query exposed as a paged data source.
StreamingSeries
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.
WorkbookSource
One workbook with a dataset per sheet.

Enums§

CellValue
A borrowed cell value.
ColumnType
The type of one column.
ColumnValues
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.
DataError
Why a data source could not read.
DataValue
An owned value, used by the query evaluator and streaming buffers.
JoinKind
How a join treats rows without a match.
LinkMode
How linked views react to a selection.
StreamMode
Whether a streaming series accepts new points.
UnitError
Why a column cannot be converted.
ValidationIssue
One failed validation.
ValidationRule
A rule checked by validate.
WindowFunction
A computed column over one value series.

Constants§

MAX_FILE_BYTES
Largest file a connector or the viewer reads into memory.

Traits§

DataSource
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 value from 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 _right suffix.
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/.feather file 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 rules against data.
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.