Linting fixes
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
564a243be2
commit
5e9f0db4bd
|
@ -743,23 +743,23 @@ from data ["age"] : ["age" gt 18];
|
||||||
pub fn test_series_min() {
|
pub fn test_series_min() {
|
||||||
let res = process(r#"series((2..4).collect()).min()"#);
|
let res = process(r#"series((2..4).collect()).min()"#);
|
||||||
dbg!(&res);
|
dbg!(&res);
|
||||||
let s = res.into_scalar().as_float().unwrap();
|
let s = res.into_scalar();
|
||||||
assert_eq!(s, 2.0);
|
assert_eq!(s, "2.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
pub fn test_series_max() {
|
pub fn test_series_max() {
|
||||||
let res = process(r#"series((2..4).collect()).max()"#);
|
let res = process(r#"series((2..4).collect()).max()"#);
|
||||||
dbg!(&res);
|
dbg!(&res);
|
||||||
let s = res.into_scalar().as_float().unwrap();
|
let s = res.into_scalar();
|
||||||
assert_eq!(s, 3.0);
|
assert_eq!(s, "3.0");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
pub fn test_series_mean() {
|
pub fn test_series_mean() {
|
||||||
let res = process(r#"series((1..51).collect()).mean()"#);
|
let res = process(r#"series((1..51).collect()).mean()"#);
|
||||||
dbg!(&res);
|
dbg!(&res);
|
||||||
let s = res.into_scalar().as_float().unwrap();
|
let s = res.into_scalar();
|
||||||
assert_eq!(s, 25.5);
|
assert_eq!(s, "25.5");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use crate::dataframe;
|
use crate::dataframe;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -46,26 +46,6 @@ impl Default for AppData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AppData {
|
|
||||||
pub fn process(&mut self) {
|
|
||||||
let mut engine = abacus_core::Engine::default();
|
|
||||||
|
|
||||||
for mut block in self.blocks.iter_mut() {
|
|
||||||
let start = std::time::Instant::now();
|
|
||||||
block.output = engine.process_script(&block.editor_data.content.to_string());
|
|
||||||
println!("block executed in {}", start.elapsed().as_millis());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn process_block(&mut self, index: usize) {
|
|
||||||
let mut engine = abacus_core::Engine::default();
|
|
||||||
if let Some(block) = self.blocks.get_mut(index) {
|
|
||||||
let start = std::time::Instant::now();
|
|
||||||
block.output = engine.process_script(&block.editor_data.content.to_string());
|
|
||||||
println!("block executed in {}", start.elapsed().as_millis());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Data, Lens, Default, PartialEq, Debug)]
|
#[derive(Clone, Data, Lens, Default, PartialEq, Debug)]
|
||||||
pub struct Block {
|
pub struct Block {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
|
Loading…
Reference in New Issue