global: snapshot

This commit is contained in:
nym21
2025-03-02 12:45:33 +01:00
parent 0453b6903a
commit ceefc8ffc6
14 changed files with 113 additions and 94 deletions

View File

@@ -72,10 +72,17 @@ impl Computer {
// exit,
// )?;
self.vecs.height_to_height.compute_transform(
starting_indexes.height,
&mut indexer.vecs.height_to_timestamp,
|_, height| height,
exit,
)?;
self.vecs.height_to_date.compute_transform(
starting_indexes.height,
&mut indexer.vecs.height_to_timestamp,
|timestamp| Date::from(*timestamp),
|timestamp, _| Date::from(*timestamp),
exit,
)?;

View File

@@ -25,6 +25,7 @@ pub struct Vecs {
pub dateindex_to_open_in_dollars: StorableVec<Dateindex, Open<Dollars>>,
pub height_to_close_in_cents: StorableVec<Height, Close<Cents>>,
pub height_to_close_in_dollars: StorableVec<Height, Close<Dollars>>,
pub height_to_height: StorableVec<Height, Height>,
pub height_to_high_in_cents: StorableVec<Height, High<Cents>>,
pub height_to_high_in_dollars: StorableVec<Height, High<Dollars>>,
pub height_to_low_in_cents: StorableVec<Height, Low<Cents>>,
@@ -101,6 +102,7 @@ impl Vecs {
&path.join("height_to_close_in_dollars"),
Version::from(1),
)?,
height_to_height: StorableVec::import(&path.join("height_to_height"), Version::from(1))?,
height_to_high_in_cents: StorableVec::import(&path.join("height_to_high_in_cents"), Version::from(1))?,
height_to_high_in_dollars: StorableVec::import(&path.join("height_to_high_in_dollars"), Version::from(1))?,
height_to_low_in_cents: StorableVec::import(&path.join("height_to_low_in_cents"), Version::from(1))?,
@@ -152,6 +154,7 @@ impl Vecs {
pub fn as_any_vecs(&self) -> Vec<&dyn AnyStorableVec> {
vec![
&self.height_to_date as &dyn AnyStorableVec,
&self.height_to_height,
// &self.dateindex_to_close_in_dollars,
// &self.dateindex_to_high_in_cents,
// &self.dateindex_to_high_in_dollars,