chapaty 0.1.4

A software to backtest trading strategies.
Documentation
1
2
3
4
5
6
7
8
9
use crate::{chapaty, bot::time_frame_snapshot::TimeFrameSnapshot};
use polars::prelude::DataFrame;
use std::str::from_utf8;

pub fn deserialize_data_frame_map(bytes: Vec<u8>) -> chapaty::types::DataFrameMap {
    let df_map_as_str = from_utf8(&bytes).expect("DataFrameMapVec is not valid UTF-8");
    let df_map_as_vec: Vec<(TimeFrameSnapshot, DataFrame)> = serde_json::from_str(&df_map_as_str).unwrap();
    df_map_as_vec.into_iter().collect()
}