Redo time-series spec.
[?]
CrEcTsRjb1hHQjHuumqRfqdbVV4X58iLEubi4noaDPFa
Jul 21, 2021, 12:43 AM
2CCG6KUP6VL2Q7WQKLVNIPPGZWHSWIOWETRCS3APZTV4WSF5GLWACDependencies
- [2]
AZQVIGSMFirst record - [3]
K4CH53V4Added GPL2 license, included missing source files. - [4]
GQVS55HIFinished generate_ts_spec() function. - [5]
SPSFTMLRCompleted loading ts_data from specification. - [6]
77SIQZ3ESeparating out spec generation. - [7]
A6ZAYJNBDebugging DataSelector - [8]
4MG5JFXTFirst record. - [9]
JTX5OHWHAdded USA CPI. - [10]
YJXKWWM6Added max() min() n GraphicJson and cleaned up serialization - [11]
UKQAGL5FChecked ts_json toolchain. - [12]
GUXZCEWWAdded Country enum. - [13]
XI5ALEH6Take advantage of keytree FromStr functionality. - [14]
TTR5IFSGWorking on building generic TSSpec. - [15]
UUD3CJZLMaking error handling more comprehensive. - [16]
2SABVMY3Finished into_json() functionality. - [17]
4QOTH75IFixed UI specification code. - [18]
LVMGQJGHFinished framework for checking series specifications with data. - [19]
U4VCAFXQAdded data_type to TSSpec key. - [20]
SAHJYVNBRemoved checking functionality.
Change contents
- file move: tests → tests
- file move: test.rs → test.rs
- file move: src → src.AZQVIGSM6OJHM
- file move: response.rs → response.rs
- file move: lib.rs → lib.rs
- file move: src → src
- file move: ui.rs → ui.rs
- edit in src/ui.rs at line 7
use std::str::FromStr; - edit in src/ui.rs at line 19
DateRange, - edit in src/ui.rs at line 24
- edit in src/ui.rs at line 190
- replacement in src/ui.rs at line 222
let range = MonthlyDate::range(&self.start_date, &self.end_date);let range = DateRange::new(&self.start_date, &self.end_date); - replacement in src/ui.rs at line 227
xy_data.with_range(&range);xy_data.with_range(&range.0); - edit in src/ui.rs at line 253[4.3675]→[4.3675:3678](∅→∅),[4.3678]→[4.3966:4050](∅→∅),[4.4050]→[4.1930:1955](∅→∅),[4.1930]→[4.1930:1955](∅→∅)
}/// Transforms from a TimeSeries<1> to another TimeSeries<1>.pub enum Transform1 {/// No-opIdent, - edit in src/ui.rs at line 255
impl FromStr for Transform1 {type Err = Error; - edit in src/ui.rs at line 256[4.4224]→[4.2008:2080](∅→∅),[4.2080]→[4.4082:4128](∅→∅),[4.4128]→[4.44:105](∅→∅),[4.105]→[4.4171:4457](∅→∅),[4.4171]→[4.4171:4457](∅→∅),[4.4457]→[4.106:199](∅→∅),[4.199]→[4.4843:4853](∅→∅),[4.1010]→[4.4843:4853](∅→∅),[4.2197]→[4.4843:4853](∅→∅),[4.4500]→[4.4843:4853](∅→∅),[4.4843]→[4.4843:4853](∅→∅),[4.4870]→[4.4870:4876](∅→∅),[4.5034]→[4.5034:5036](∅→∅),[4.5392]→[4.5392:5393](∅→∅)
fn from_str(s: &str) -> Result<Self, Self::Err> {match s {"ident" => Ok(Transform1::Ident),_ => Err(parse_transform1(file!(), line!(), s)),}}}/// Transforms from two TimeSeries<1> to a TimeSeries<2>.pub enum Transform2 {///Zip,}impl FromStr for Transform2 {type Err = Error;fn from_str(s: &str) -> Result<Self, Self::Err> {match s {"zip" => Ok(Transform2::Zip),_ => {Err(parse_transform2(file!(), line!(), s))},}}} - file move: ts.rs → ts.rs
- replacement in src/ts.rs at line 1
#![allow(dead_code)]// #![allow(dead_code)] - edit in src/ts.rs at line 8
use std::str::FromStr; - edit in src/ts.rs at line 28
DateRange, - edit in src/ts.rs at line 37[3.54]→[4.1136:1733](∅→∅),[4.117]→[4.1136:1733](∅→∅),[4.1136]→[4.1136:1733](∅→∅),[4.1733]→[4.7998:7999](∅→∅),[4.7998]→[4.7998:7999](∅→∅),[4.7999]→[4.1734:1989](∅→∅),[4.1989]→[4.8099:8100](∅→∅),[4.8099]→[4.8099:8100](∅→∅),[4.8100]→[4.1990:2296](∅→∅),[4.2296]→[4.0:17](∅→∅),[4.626]→[4.0:17](∅→∅),[4.17]→[4.2297:2346](∅→∅),[4.666]→[4.8147:8148](∅→∅),[4.2346]→[4.8147:8148](∅→∅),[4.8147]→[4.8147:8148](∅→∅),[4.8148]→[4.2347:2361](∅→∅),[4.681]→[4.8166:8167](∅→∅),[4.2361]→[4.8166:8167](∅→∅),[4.8166]→[4.8166:8167](∅→∅),[4.8167]→[4.2362:2550](∅→∅),[4.738]→[4.8231:8238](∅→∅),[4.2550]→[4.8231:8238](∅→∅),[4.8231]→[4.8231:8238](∅→∅),[4.8238]→[4.2551:2619](∅→∅),[4.2619]→[4.8314:8320](∅→∅),[4.8314]→[4.8314:8320](∅→∅),[4.8320]→[4.787:788](∅→∅),[4.788]→[4.2620:2954](∅→∅),[4.2954]→[4.364:370](∅→∅),[4.980]→[4.364:370](∅→∅),[4.370]→[4.2955:2957](∅→∅),[4.2957]→[4.370:371](∅→∅),[4.370]→[4.370:371](∅→∅),[4.371]→[4.2958:3037](∅→∅),[4.3037]→[4.868:869](∅→∅),[4.868]→[4.868:869](∅→∅),[4.869]→[4.3038:3050](∅→∅),[4.3050]→[4.344:345](∅→∅),[4.869]→[4.344:345](∅→∅),[4.345]→[4.3051:3114](∅→∅),[4.3114]→[4.943:944](∅→∅),[4.943]→[4.943:944](∅→∅),[4.944]→[4.3115:3156](∅→∅),[4.3156]→[4.5366:5367](∅→∅),[4.1002]→[4.5366:5367](∅→∅),[4.5367]→[4.3157:3192](∅→∅),[4.3192]→[4.346:347](∅→∅),[4.5367]→[4.346:347](∅→∅),[4.347]→[4.3193:3576](∅→∅),[4.3576]→[4.1154:1170](∅→∅),[4.1154]→[4.1154:1170](∅→∅),[4.1170]→[4.3577:3619](∅→∅),[4.3619]→[4.1211:1221](∅→∅),[4.1211]→[4.1211:1221](∅→∅),[4.1221]→[4.3620:3805](∅→∅),[4.1241]→[4.980:986](∅→∅),[4.3805]→[4.980:986](∅→∅),[4.980]→[4.980:986](∅→∅),[4.986]→[4.8320:8323](∅→∅),[4.2151]→[4.8320:8323](∅→∅),[4.8320]→[4.8320:8323](∅→∅),[4.8323]→[3.55:72](∅→∅),[3.72]→[4.3834:4209](∅→∅),[4.3834]→[4.3834:4209](∅→∅),[4.1131]→[4.8557:8567](∅→∅),[4.4209]→[4.8557:8567](∅→∅),[4.8557]→[4.8557:8567](∅→∅),[4.8578]→[4.8578:8584](∅→∅),[4.8586]→[4.8586:8587](∅→∅),[4.8587]→[4.4210:4316](∅→∅),[4.4316]→[3.73:2012](∅→∅),[4.1325]→[4.8825:8834](∅→∅),[3.2012]→[4.8825:8834](∅→∅),[4.4316]→[4.8825:8834](∅→∅),[4.8825]→[4.8825:8834](∅→∅)
// --- Client-facing data-structures --------------------------------------------------------------/// `(DataType, Country)` key to lookup data or spec.#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]pub struct PageKey {///pub country: Country,///pub data_type: DataType,///pub index: usize,}impl PageKey {/// Return a new `PageKey`.pub fn new(country: Country, data_type: DataType, index: usize) -> Self {PageKey { country, data_type, index }}}impl<'a> TryInto<PageKey> for KeyTreeRef<'a> {type Error = keytree::Error;fn try_into(self) -> Result<PageKey, Self::Error> {Ok(PageKey {index: self.value("key::index")?,data_type: self.value("key::data_type")?,country: self.value("key::country")?,})}}/// Represents a series of graphics to be plotted on one page. A `PageKey` is a combination of/// `Country` and `DataType`. It is served to the client as one chunk of JSON.// GraphicJson. Json holds the JSON serialization as a String. PageJson is the largest component// that is serializable into JSON.#[derive(Debug)]pub struct TSData(pub HashMap<PageKey, String>);impl TSData {/// Build time-series data from a time-series specification.pub fn from_spec(spec: &Spec, root_path: &str) -> Result<Self, Error> {spec.into_data(root_path)}pub (crate) fn new() -> TSData {TSData(HashMap::new())}pub (crate) fn insert(&mut self, key: &PageKey, value: String) {match self.0.get_mut(key) {Some(_) => {println!("Tried to insert page_key: {:?} twice.", key);panic!();},None => {self.0.insert(*key, value);},}}}/// Converts specification data into `TSData`.pub struct Json(Vec<PageJson>);impl Json {pub (crate) fn into_data(&self) -> Result<TSData, Error> {let mut ts_data = TSData::new();for page_json in &self.0 {let key = PageKey::new(page_json.country,page_json.data_type,page_json.index);let value = match serde_json::to_string(&page_json) {Ok(s) => s,Err(err) => {eprintln!("{}", err.to_string());panic!();},};ts_data.insert(&key, value);}Ok(ts_data)}pub (crate) fn new() -> Self {Json(Vec::new())}pub (crate) fn push(&mut self, page_json: PageJson) {self.0.push(page_json);}}#[derive(Debug)]/// Serializable into JSON data for a time-series HTML page.pub struct PageJson {country: Country,data_type: DataType,index: usize,graphics: Vec<GraphicJson>,}impl PageJson {pub (crate) fn new(country: Country, data_type: DataType, index: usize) -> Self {PageJson {country, data_type, index, graphics: Vec::new()}}pub (crate) fn push(&mut self, graphic_json: GraphicJson) {self.graphics.push(graphic_json);}pub (crate) fn max(&self) -> f32 {self.graphics.iter().map(|graphic| graphic.max()).fold(f32::NEG_INFINITY, |a, b| a.max(b))}pub (crate) fn min(&self) -> f32 {self.graphics.iter().map(|graphic| graphic.min()).fold(f32::INFINITY, |a, b| a.min(b))}pub (crate) fn first_date(&self) -> MonthlyDate {match self.graphics.iter().map(|graphic| graphic.first_date().0).min(){Some(date) => MonthlyDate(date),None => {// No data in series?eprintln!("Could not calculate first date.");panic!()},}}pub (crate) fn last_date(&self) -> MonthlyDate {match self.graphics.iter().map(|graphic| graphic.last_date().0).max(){Some(date) => MonthlyDate(date),None => {// No data in series?eprintln!("Could not calculate last date.");panic!()},}}}impl Serialize for PageJson {fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>whereS: Serializer,{let mut page_json = serializer.serialize_struct("Json", 6)?;page_json.serialize_field("country", &self.country)?;page_json.serialize_field("data_type", &self.data_type)?;page_json.serialize_field("index", &self.index)?;page_json.serialize_field("max", &self.max())?;page_json.serialize_field("min", &self.min())?;page_json.serialize_field("first_date", &self.first_date())?;page_json.serialize_field("last_date", &self.last_date())?;page_json.serialize_field("graphics", &self.graphics)?;page_json.serialize_field("height", &GRAPHIC_HEIGHT)?;page_json.end()}} - edit in src/ts.rs at line 38[3.2014]→[4.4317:4390](∅→∅),[4.8834]→[4.4317:4390](∅→∅),[4.4390]→[4.118:135](∅→∅),[4.135]→[4.4418:4443](∅→∅),[4.4418]→[4.4418:4443](∅→∅),[4.4443]→[4.2247:2255](∅→∅),[4.1723]→[4.2247:2255](∅→∅),[4.2255]→[4.4444:4473](∅→∅),[4.4473]→[4.2265:2273](∅→∅),[4.5830]→[4.2265:2273](∅→∅),[4.1782]→[4.2265:2273](∅→∅),[4.2273]→[4.4474:4535](∅→∅),[4.4535]→[4.8930:8933](∅→∅),[4.8930]→[4.8930:8933](∅→∅),[4.8933]→[4.4536:4670](∅→∅),[4.4670]→[4.136:141](∅→∅),[4.141]→[4.9110:9126](∅→∅),[4.2463]→[4.9110:9126](∅→∅),[4.4670]→[4.9110:9126](∅→∅),[4.9110]→[4.9110:9126](∅→∅),[4.9126]→[4.1964:1965](∅→∅),[4.1965]→[4.4671:4811](∅→∅),[4.4811]→[4.142:590](∅→∅),[4.590]→[4.5981:5987](∅→∅),[4.4811]→[4.5981:5987](∅→∅),[4.5981]→[4.5981:5987](∅→∅),[4.5987]→[4.591:592](∅→∅),[4.592]→[3.2015:2863](∅→∅),[3.2863]→[4.592:740](∅→∅),[4.592]→[4.592:740](∅→∅),[4.740]→[4.4812:4814](∅→∅),[4.5987]→[4.4812:4814](∅→∅),[4.4814]→[4.741:896](∅→∅),[4.896]→[3.2864:2943](∅→∅),[3.2943]→[4.1144:1145](∅→∅),[4.1144]→[4.1144:1145](∅→∅),[4.1225]→[4.1225:1471](∅→∅),[4.1471]→[3.2944:3088](∅→∅),[3.3088]→[4.1471:1508](∅→∅),[4.1471]→[4.1471:1508](∅→∅)
/// GraphicJson is the largest component that is serializable into JSON.#[derive(Debug)]pub struct GraphicJson {///pub height: Option<f32>,///pub series: Vec<(RegularTimeSeries<1>, SeriesMetaData)>,}impl GraphicJson {pub (crate) fn new() -> Self {GraphicJson {height: None,series: Vec::new(),}}pub (crate) fn push(&mut self, time_series: RegularTimeSeries<1>, meta: SeriesMetaData) {self.series.push((time_series, meta))}/// Calculate the maximum value of all series in `Self`.pub (crate) fn max(&self) -> f32 {self.series.iter().map(|(ts, _)| ts.max(0)).fold(f32::NEG_INFINITY, |a, b| a.max(b))}/// Calculate the minimum value of all series in `Self`.pub (crate) fn min(&self) -> f32 {self.series.iter().map(|(ts, _)| ts.min(0)).fold(f32::INFINITY, |a, b| a.min(b))}/// Return first date in all series.pub (crate) fn first_date(&self) -> MonthlyDate {match self.series.iter().map(|(ts, _)| ts.first_date()).min(){Some(date) => MonthlyDate(date),None => {// No data in series?eprintln!("Could not calculate first date.");panic!()}}}/// Return last date of in all series.pub (crate) fn last_date(&self) -> MonthlyDate {match self.series.iter().map(|(ts, _)| ts.last_date()).max(){Some(date) => MonthlyDate(date),None => {// No data in series?eprintln!("Could not calculate first date.");panic!()}}}pub (crate) fn height(&self) -> f32 {match self.height {Some(h) => h,None => GRAPHIC_HEIGHT,}}}impl Serialize for GraphicJson {fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>whereS: Serializer,{let mut graphic_json = serializer.serialize_struct("GraphicJson", 6)?;graphic_json.serialize_field("height", &self.height())?;graphic_json.serialize_field("series", &self.series)?;graphic_json.serialize_field("max", &self.max())?;graphic_json.serialize_field("min", &self.min())?;graphic_json.serialize_field("first_date", &self.first_date())?;graphic_json.serialize_field("last_date", &self.last_date())?;graphic_json.end()}} - edit in src/ts.rs at line 58
// The Spec components do not map well to Json components.// 1. Json is not serializable - it is a HashMap which maps PageKeys to Strings to serve.// 2. PageJson does not exists. PageSpec.into_json creates a Vec<GraphicJson>.pub (crate) fn into_data(&self, root_path: &str) -> Result<TSData, Error> {let mut json = Json::new();for page_spec in &self.0 {let mut page_json = PageJson::new(page_spec.country,page_spec.data_type,page_spec.index,);for graphic_spec in &page_spec.graphics {let mut graphic_json = GraphicJson::new();for series_spec in &graphic_spec.seriess {let rts = data_from_file(page_spec.country,series_spec.data_type,series_spec.series_id.clone(),root_path,)?;let meta = meta_from_file(page_spec.country,series_spec.data_type,series_spec.series_id.clone(),root_path,); - edit in src/ts.rs at line 59[4.6617]→[4.6617:6784](∅→∅),[4.2586]→[4.2092:2102](∅→∅),[4.6025]→[4.2092:2102](∅→∅),[4.6784]→[4.2092:2102](∅→∅),[4.2092]→[4.2092:2102](∅→∅),[4.2102]→[4.6785:6959](∅→∅),[4.6959]→[4.2102:2108](∅→∅),[4.2102]→[4.2102:2108](∅→∅),[4.9128]→[4.9128:9129](∅→∅)
graphic_json.push(rts, meta);}page_json.push(graphic_json);}json.push(page_json);}// Now we have a Json datastructure which we can iterate over the pages, serialize, generate// keys, and build a TSData Hashmap.json.into_data()} - edit in src/ts.rs at line 119
series: Vec<SeriesSpec>, - edit in src/ts.rs at line 130
series: Vec<SeriesSpec>, - replacement in src/ts.rs at line 133
PageSpec { country, data_type, index, graphics }PageSpec { country, data_type, index, series, graphics } - edit in src/ts.rs at line 146
series: self.vec_at("page::series")?, - edit in src/ts.rs at line 150
}}/// Specifies what text a graphic displays.pub enum TextSpec {/// Specifies that graphic displays Links to series.Link,/// Specifies that graphics displays metadata.Meta,/// Specifies that graphics do not display text.None,}impl FromStr for TextSpec {type Err = Error;fn from_str(s: &str) -> Result<Self, Self::Err> {match s {"link" => Ok(TextSpec::Link),"meta" => Ok(TextSpec::Meta),_ => Err(keytree_error(file!(), line!(), "Failed to parse to Text")),} - edit in src/ts.rs at line 186
title: Option<String>, - replacement in src/ts.rs at line 188
seriess: Vec<self::SeriesSpec>,series_id: Vec<SeriesId>,fid: Vec<String>,text: TextSpec, - replacement in src/ts.rs at line 194
pub (crate) fn new() -> Self {pub (crate) fn empty() -> Self { - replacement in src/ts.rs at line 196
height: None,seriess: Vec::new(),title: None,height: None,series_id: Vec::new(),fid: Vec::new(),text: TextSpec::None, - replacement in src/ts.rs at line 204
pub (crate) fn push(&mut self, series_spec: self::SeriesSpec) {self.seriess.push(series_spec)}// pub (crate) fn push(// &mut self,// title: Option<Title>,// height: Option<f32>,// transform_spec: Vec<TransformSpec>)// {// let graph_spec = GraphSpec {// title,// height,// transform_spec,// };// self.seriess.push(series_spec)// } - replacement in src/ts.rs at line 224
GraphicSpec{height: self.opt_value("graphic::height")?,seriess: self.vec_at("graphic::series")?,GraphicSpec {title: self.opt_value("graphic::title")?,height: self.opt_value("graphic::height")?,series_id: self.vec_value("graphic::series_id")?,fid: self.vec_value("graphic::fid")?,text: self.value("graphic::text")?, - edit in src/ts.rs at line 243
#[derive(Debug)] - edit in src/ts.rs at line 247
date_range: DateRange,transforms: Vec<Transform>,fid: Option<FID>, - edit in src/ts.rs at line 253
- replacement in src/ts.rs at line 255
pub fn new(data_type: DataType, series_id: SeriesId) -> Self {pub fn new(data_type: DataType,series_id: SeriesId,date_range: DateRange,transforms: Vec<Transform>,fid: Option<FID>,) -> Self { - edit in src/ts.rs at line 265
date_range,transforms,fid, - edit in src/ts.rs at line 276
let first_date = self.opt_value("series::first_date")?;let last_date = self.opt_value("series::last_date")?;let date_range = DateRange::new(&first_date, &last_date); - replacement in src/ts.rs at line 284
SeriesSpec{data_type: self.value("series::data_type")?,series_id: self.value("series::series_id")?,SeriesSpec {data_type: self.value("series::data_type")?,series_id: self.value("series::series_id")?,date_range,transforms: self.vec_value("series::transform")?,fid: self.opt_value("series::fid")?, - edit in src/ts.rs at line 293
}// === Transforms ==================================================================================/// Transforms from a TimeSeries<1> to another TimeSeries<1>.#[derive(Debug)]pub enum Transform {///ToMonthly,///ToQuarterly,/// Year on year percentage change.YearOnYear, - edit in src/ts.rs at line 308
impl FromStr for Transform {type Err = Error; - edit in src/ts.rs at line 311
fn from_str(s: &str) -> Result<Self, Self::Err> {match s {"to_monthly" => Ok(Transform::ToMonthly),"to_quarterly" => Ok(Transform::ToQuarterly),"yoy" => Ok(Transform::YearOnYear),_ => Err(parse_transform1(file!(), line!(), s)),}}}/// SeriesIdentifierAfterTransform#[derive(Debug)]pub struct FID(String); - edit in src/ts.rs at line 325
impl FID {pub (crate) fn new(series_id: &SeriesId, f: Vec<Transform>) -> Self {let mut s = format!("{}_",series_id,);for transform in f {match transform {Transform::ToMonthly => { s.push('m') },Transform::ToQuarterly => { s.push('q') },Transform::YearOnYear => { s.push('y') },}}FID(s)}} - edit in src/ts.rs at line 342
impl FromStr for FID {type Err = Error; - edit in src/ts.rs at line 345[4.10478]
fn from_str(s: &str) -> Result<Self, Self::Err> {Ok(FID(String::from(s)))}} - file move: main.rs → main.rs
- replacement in src/main.rs at line 18
use ui_data::ui::*;// use ui_data::ui::*; - replacement in src/main.rs at line 56
let ts_spec = ts::Spec::from_file("ts_spec.keytree").unwrap();// let ts_spec = ts::Spec::from_file("ts_spec.keytree").unwrap(); - replacement in src/main.rs at line 58
let ts_data = TSData::from_spec(&ts_spec, &root_dir).unwrap();// let ts_data = TSData::from_spec(&ts_spec, &root_dir).unwrap(); - replacement in src/main.rs at line 60
dbg!(&ts_data);// dbg!(&ts_data); - file move: lib.rs → lib.rs
- replacement in src/lib.rs at line 175
pub mod ui;// pub mod ui; - edit in src/lib.rs at line 201
DateRange, - edit in src/lib.rs at line 205
use crate::error::Error; - replacement in src/lib.rs at line 226
#[derive(Serialize)]#[derive(Clone, Serialize)] - edit in src/lib.rs at line 228
impl MonthlyDate {/// Create a time_series::DateRange.pub fn range(date_opt1: &Option<MonthlyDate>,date_opt2: &Option<MonthlyDate>) -> time_series::DateRange{time_series::DateRange::new(date_opt1.as_ref().map(|date| date.0),date_opt2.as_ref().map(|date| date.0),)}} - edit in src/lib.rs at line 239
/// `DateRange` newtype.#[derive(Debug)]pub struct DateRange(time_series::DateRange); - edit in src/lib.rs at line 243
impl DateRange { - edit in src/lib.rs at line 245
/// Create a time_series::DateRange.pub fn new(first_date: &Option<MonthlyDate>,last_date: &Option<MonthlyDate>) -> DateRange{DateRange(time_series::DateRange::new(&first_date.clone().map(|d| d.0),&last_date.clone().map(|d| d.0),))}///pub fn first_date(&self) -> Option<MonthlyDate> {self.0.first_date().map(|date| MonthlyDate(date))}///pub fn last_date(&self) -> Option<MonthlyDate> {self.0.last_date().map(|date| MonthlyDate(date))}} - replacement in src/lib.rs at line 449
/// Build a generic `Spec` from `Self`.pub fn generic_ts_spec(&self) -> ts::Spec {// /// Build a generic `Spec` from `Self`.// pub fn generic_ts_spec(&self) -> ts::Spec { - replacement in src/lib.rs at line 452
let mut ts_spec = ts::Spec::new();// let mut ts_spec = ts::Spec::new(); - replacement in src/lib.rs at line 454
for ((data_type, country), series_specs) in self.map.iter() {// for ((data_type, country), series_specs) in self.map.iter() { - replacement in src/lib.rs at line 456
let mut ts_graphic_spec = ts::GraphicSpec::new();// let mut graphic_spec = ts::GraphicSpec::empty(); - replacement in src/lib.rs at line 458[4.5194]→[4.5194:5240](∅→∅),[4.5240]→[4.13804:13862](∅→∅),[4.13862]→[4.5296:5477](∅→∅),[4.5296]→[4.5296:5477](∅→∅)
for series_spec in series_specs {let ts_series_spec = ts::SeriesSpec::new(series_spec.data_type,series_spec.series_id.clone());ts_graphic_spec.push(ts_series_spec);};// let series_id = series_spec.series_id;// let f = Vec::new();// for series_spec in series_specs {// let series_spec = ts::SeriesSpec::new(// series_spec.data_type,// series_id,// DateRange::new(&None, &None),// f,// FID::new(series_id, f),// );// graphic_spec.push(series_spec);// }; - replacement in src/lib.rs at line 472
let ts_page_spec = ts::PageSpec::new(*country,*data_type,0,vec!(ts_graphic_spec),);// let page_spec = ts::PageSpec::new(// *country,// *data_type,// 0,// Vec::new(),// vec!(graphic_spec),// ); - replacement in src/lib.rs at line 480
ts_spec.push(ts_page_spec);}ts_spec}// spec.push(ts_page_spec);// }// spec// } - replacement in src/lib.rs at line 792
for date_point in rts.iter(DateRange::new(None, None)) {for date_point in rts.iter(DateRange::new(&None, &None).0) { - edit in src/lib.rs at line 1067[4.23902]
- file move: fred.rs → fred.rs
- file move: error.rs → error.rs
- file move: LICENSE → LICENSE
- file move: Cargo.toml → Cargo.toml.AZQVIGSM6OJHM
- file move: Cargo.toml → Cargo.toml