UKQAGL5F5LWZZR7RWFJI3H2MW6LXPRGPXAIGNBZI5IVJLWUFHLGAC
UUD3CJZLSTAVLMIXIWE4CHN5HQSFM6K3DCPWECJMKGXDOROK4G4AC
U4VCAFXQNTKC7KWWE3B2JJMZMFRGLBOHSZIOXCE6EEXW7WE2Q5NAC
GQVS55HIQLU7KPJNRMF57QUM4EATSWFQRCS7ZEJMJPUXFX2NHSYAC
77SIQZ3EGGV6KSECMLPDKQFGEC7CCFAPWGER7ZARQ5STDKJNU6GQC
GUXZCEWWPBCHXO26JVWZ74CTSDFDDO775YR7FKY7UGVZCA7GCSYAC
SAHJYVNBUBBIUBI4ZMAXK4QJFOT54M5UA3W2HQMTNDSP3GGCRX7QC
TTR5IFSG25VNBQ2F2FNOLUMTEIHVBHFOEXYB2ZWEHWOURUV4GJMQC
A6ZAYJNBYFXPUTCHTQDGAWUZIYOXNO3IJBN73ZX6PEJ3T4NMNOGQC
4MG5JFXTKAE3SOVKGGNKEUTNCKOWEBHTGKVZHJWLWE3PTZTQKHPAC
2SABVMY3A2RZDF3KJXZSMJ2UQ4Q5EW422G4DVBJRKK26S2ESGVQAC
// DataSpec::from_file("source_data.keytree").write(&root_dir);
// let series_obs = Fred::series_observations("NORURTOTADSMEI").unwrap();
// let () = series_obs;
// Get series_spec using series_id
let data_spec = DataSpec::from_file("source_data.keytree").unwrap();
let ts_spec = TSSpec::from_file("ts_spec.keytree");
// Its better for DataSpec to be a Vec, but we need to index into the Vec, so
// we wrap it with an index.
// `DataSpec` is set up in what seems like an overly complex way in order to maintain
// the order is which data is `DataSelector` orders the series. We want to maintain an
// ordering by (DataType, Country). But sometimes we also need to search by SeriesId so also need a
// reverse lookup.
pub fn resume_write(&self, series_id: SeriesId, root_path: &str) {
for (series_id, _) in self.reverse.iter().skip_while(|(id, _)| id != &&series_id) {
let series_spec = self.get_series_spec(series_id);
series_spec.write_data(root_path);
series_spec.write_meta(root_path);
pub fn resume_write(&self, series_id: &str, root_path: &str) {
let sid = SeriesId::new(series_id);
for ((data_type, country), series_specs) in self
.map
.iter()
.skip_while(|((data_type, country), series_specs)| {
match self.key_has_series_id((*data_type, *country), &sid) {
Err(err) => {
println!("{}", err);
panic!();
},
Ok(is_true) => !is_true,
}
})
{
for series_spec in series_specs {
series_spec.write_data(root_path);
series_spec.write_meta(root_path);
}