Data management library for Rust. It provides data structs and utilities for data loading, preprocessing, aggregation, manipulation, viewing, and serialization.
agnes works with heterogeneously-typed labeled tabular data -- a group of fields
(columns) each with a label and distinct data type, where each field has the same number
The primary data storage structure in
agnes is the DataStore, which
is a list of FieldData objects which each contain the data for a
single field. A
DataStore contains all of the data loaded from a single source into a program, and
once data is added to a
DataStore it is immutable.
The primary data structure used by the end user of this library is the
DataView, which references one or more
DataFrame objects, each of which holds a reference and provides
access to a single
DataView struct provides a way of selecting
fields (columns) across one or more data sources, with the
DataFrame struct providing a way to
select specific rows from those data sources (after, for example, a filtering or join operation).
The FieldSelect and
SelectFieldByLabel traits provide methods to access a single
field from a
DataView. They return a type that implements
DataIndex, which provides accessor methods to the data of that field:
an index-based method get_datum and an iterator
provided by iter.
agnes makes extensive use of heterogeneous cons-lists
to provide data structures that can hold data of varying types (as long as the types are known to
the user of the library at compile time). Much of this framework was originally inspired by the
frunk Rust library and the
HList Haskell library.
DataStore struct, a cons-list is used to hold a list of the the
FieldData objects (each
type-parameterized on a potentially different type). The
DataView struct has a cons-list of
labels referenced by that
DataView along with another cons-list of
DataFrames for each data
source it references.
Traits for accessing data within agnes data structures.
Basic heterogeneous list (cons-list) implementation.
General error struct and helpful conversions.
Data structures and implementations for fields.FieldData
Type aliases and macro for handling specifications of fields in a data source.
Structs and implementation for row-selecting data structure.
Traits and implementations to handle joining or merging two
Traits, structs, and type aliases for handling cons-list element labels and associated logic.
Framework for partial function handling (where some functionality is implemented for some but not all of the data types of fields in a data structure).
Traits for selecting a field from a data structure.
Useful statistics-calculating traits for fields with numeric data.
Data storage struct and implementation.
Functions for generating sample data tables for tests.
Functions for displaying statistics about a
Create a LabelCons cons-list based on a list of provided labels. Used to specify a list of field labels to operate over.
Macro for declaring field labels. Used by tablespace macro.
Macro for handling creation of the first label in a table. Used by declare_fields.
Utility macro to determine the length of a cons-list.
Macro for handling creation of the subsequent (non-initial) labels in a table. Used by declare_fields.
Macro for creating a source specification structure used to specify how to extract fields from a data source. It correlates labels (defined using the tablespace macro) to field / column names or indices in a data source. This source specification structure is implemented as a
Declares a set of data tables that all occupy the same tablespace (i.e. can be merged or
joined together). This macro should be used at the beginning of any
Small utility macro to construct a Value enum with a reference to an existing value. Typically only used for tests.