-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
749 additions
and
205 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
use std::fmt::Debug; | ||
//! Data module | ||
//! | ||
//! This module defines the `Data` trait and its implementations. | ||
use dyn_clone::DynClone; | ||
use std::fmt::Debug; | ||
|
||
pub mod polars; | ||
|
||
pub trait Data: Debug + DynClone { | ||
/// # Data trait | ||
/// | ||
/// This trait abstracts the data source for the [`Plot`](crate::Plot) struct. | ||
pub trait Data: Debug { | ||
/// Get a column as a vector of f64 values. | ||
fn column_f64(&self, column_name: &str) -> Vec<f64>; | ||
|
||
/// Get the minimum and maximum values of a column. | ||
fn column_range_f64(&self, column_name: &str) -> (f64, f64); | ||
|
||
/// Get the length of a column. | ||
fn column_len(&self, column_name: &str) -> usize; | ||
} | ||
|
||
dyn_clone::clone_trait_object!(Data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//! `Data` implementation for `polars` DataFrame | ||
use polars::prelude::*; | ||
|
||
impl super::Data for DataFrame { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.