diff --git a/crates/brk_computer/src/internal/derived/mod.rs b/crates/brk_computer/src/internal/derived/mod.rs deleted file mode 100644 index edb1120e5..000000000 --- a/crates/brk_computer/src/internal/derived/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod full; -mod last; -mod lazy_last; -mod lazy_amount; -mod map_option; -mod transform_last; - -pub use full::*; -pub use last::*; -pub use lazy_last::*; -pub use lazy_amount::*; -pub use map_option::*; -pub use transform_last::*; diff --git a/crates/brk_computer/src/internal/derived/lazy_amount.rs b/crates/brk_computer/src/internal/from_height/amount/lazy_derived.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/lazy_amount.rs rename to crates/brk_computer/src/internal/from_height/amount/lazy_derived.rs diff --git a/crates/brk_computer/src/internal/from_height/amount/mod.rs b/crates/brk_computer/src/internal/from_height/amount/mod.rs index 933d338aa..d0e61ddba 100644 --- a/crates/brk_computer/src/internal/from_height/amount/mod.rs +++ b/crates/brk_computer/src/internal/from_height/amount/mod.rs @@ -2,9 +2,11 @@ mod cumulative; mod cumulative_sum; mod full; mod lazy; +mod lazy_derived; mod rolling; mod rolling_full; mod rolling_sum; +mod windows; use brk_error::Result; use brk_traversable::Traversable; @@ -27,6 +29,8 @@ pub use lazy::*; pub use rolling::*; pub use rolling_full::*; pub use rolling_sum::*; +pub use lazy_derived::*; +pub use windows::*; #[derive(Traversable)] pub struct AmountFromHeight { diff --git a/crates/brk_computer/src/internal/rolling/amount_windows.rs b/crates/brk_computer/src/internal/from_height/amount/windows.rs similarity index 100% rename from crates/brk_computer/src/internal/rolling/amount_windows.rs rename to crates/brk_computer/src/internal/from_height/amount/windows.rs diff --git a/crates/brk_computer/src/internal/from_height/base.rs b/crates/brk_computer/src/internal/from_height/computed/base.rs similarity index 100% rename from crates/brk_computer/src/internal/from_height/base.rs rename to crates/brk_computer/src/internal/from_height/computed/base.rs diff --git a/crates/brk_computer/src/internal/from_height/constant.rs b/crates/brk_computer/src/internal/from_height/computed/constant.rs similarity index 100% rename from crates/brk_computer/src/internal/from_height/constant.rs rename to crates/brk_computer/src/internal/from_height/computed/constant.rs diff --git a/crates/brk_computer/src/internal/derived/last.rs b/crates/brk_computer/src/internal/from_height/computed/derived.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/last.rs rename to crates/brk_computer/src/internal/from_height/computed/derived.rs diff --git a/crates/brk_computer/src/internal/derived/full.rs b/crates/brk_computer/src/internal/from_height/computed/derived_full.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/full.rs rename to crates/brk_computer/src/internal/from_height/computed/derived_full.rs diff --git a/crates/brk_computer/src/internal/from_height/computed/mod.rs b/crates/brk_computer/src/internal/from_height/computed/mod.rs index 91c98b93f..9ff8be601 100644 --- a/crates/brk_computer/src/internal/from_height/computed/mod.rs +++ b/crates/brk_computer/src/internal/from_height/computed/mod.rs @@ -1,16 +1,24 @@ mod aggregated; +mod base; +mod constant; mod cumulative; mod cumulative_sum; mod delta; +mod derived; +mod derived_full; mod fiat_delta; mod full; mod rolling_average; mod sum; pub use aggregated::*; +pub use base::*; +pub use constant::*; pub use cumulative::*; pub use cumulative_sum::*; pub use delta::*; +pub use derived::*; +pub use derived_full::*; pub use fiat_delta::*; pub use full::*; pub use rolling_average::*; diff --git a/crates/brk_computer/src/internal/from_height/fiat.rs b/crates/brk_computer/src/internal/from_height/fiat/base.rs similarity index 91% rename from crates/brk_computer/src/internal/from_height/fiat.rs rename to crates/brk_computer/src/internal/from_height/fiat/base.rs index f707e68ee..4b76d3589 100644 --- a/crates/brk_computer/src/internal/from_height/fiat.rs +++ b/crates/brk_computer/src/internal/from_height/fiat/base.rs @@ -4,10 +4,12 @@ use brk_types::{Cents, CentsSigned, Dollars, Version}; use schemars::JsonSchema; use vecdb::{Database, ReadableCloneableVec, Rw, StorageMode, UnaryTransform}; -use super::{ComputedFromHeight, LazyFromHeight}; use crate::{ indexes, - internal::{CentsSignedToDollars, CentsUnsignedToDollars, NumericValue}, + internal::{ + CentsSignedToDollars, CentsUnsignedToDollars, ComputedFromHeight, LazyFromHeight, + NumericValue, + }, }; /// Trait that associates a cents type with its transform to Dollars. diff --git a/crates/brk_computer/src/internal/from_height/lazy_fiat.rs b/crates/brk_computer/src/internal/from_height/fiat/lazy.rs similarity index 88% rename from crates/brk_computer/src/internal/from_height/lazy_fiat.rs rename to crates/brk_computer/src/internal/from_height/fiat/lazy.rs index d1eb217f3..14cc28d6f 100644 --- a/crates/brk_computer/src/internal/from_height/lazy_fiat.rs +++ b/crates/brk_computer/src/internal/from_height/fiat/lazy.rs @@ -2,10 +2,7 @@ use brk_traversable::Traversable; use brk_types::{Dollars, Version}; use vecdb::ReadableCloneableVec; -use super::{ComputedFromHeight, LazyFromHeight}; -use crate::internal::{Identity, NumericValue}; - -use super::fiat::CentsType; +use crate::internal::{CentsType, ComputedFromHeight, Identity, LazyFromHeight, NumericValue}; /// Lazy fiat: both cents and usd are lazy views of a stored source. /// Zero extra stored vecs. diff --git a/crates/brk_computer/src/internal/from_height/fiat/mod.rs b/crates/brk_computer/src/internal/from_height/fiat/mod.rs new file mode 100644 index 000000000..230d73479 --- /dev/null +++ b/crates/brk_computer/src/internal/from_height/fiat/mod.rs @@ -0,0 +1,5 @@ +mod base; +mod lazy; + +pub use base::*; +pub use lazy::*; diff --git a/crates/brk_computer/src/internal/from_height/lazy.rs b/crates/brk_computer/src/internal/from_height/lazy/base.rs similarity index 100% rename from crates/brk_computer/src/internal/from_height/lazy.rs rename to crates/brk_computer/src/internal/from_height/lazy/base.rs diff --git a/crates/brk_computer/src/internal/derived/lazy_last.rs b/crates/brk_computer/src/internal/from_height/lazy/derived.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/lazy_last.rs rename to crates/brk_computer/src/internal/from_height/lazy/derived.rs diff --git a/crates/brk_computer/src/internal/derived/map_option.rs b/crates/brk_computer/src/internal/from_height/lazy/map_option.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/map_option.rs rename to crates/brk_computer/src/internal/from_height/lazy/map_option.rs diff --git a/crates/brk_computer/src/internal/from_height/lazy/mod.rs b/crates/brk_computer/src/internal/from_height/lazy/mod.rs new file mode 100644 index 000000000..e3f25d977 --- /dev/null +++ b/crates/brk_computer/src/internal/from_height/lazy/mod.rs @@ -0,0 +1,9 @@ +mod base; +mod derived; +mod map_option; +mod transform_last; + +pub use base::*; +pub use derived::*; +pub use map_option::*; +pub use transform_last::*; diff --git a/crates/brk_computer/src/internal/derived/transform_last.rs b/crates/brk_computer/src/internal/from_height/lazy/transform_last.rs similarity index 100% rename from crates/brk_computer/src/internal/derived/transform_last.rs rename to crates/brk_computer/src/internal/from_height/lazy/transform_last.rs diff --git a/crates/brk_computer/src/internal/from_height/mod.rs b/crates/brk_computer/src/internal/from_height/mod.rs index 3a97df3e8..e91ffff49 100644 --- a/crates/brk_computer/src/internal/from_height/mod.rs +++ b/crates/brk_computer/src/internal/from_height/mod.rs @@ -1,25 +1,21 @@ -mod base; mod amount; mod computed; -mod constant; mod fiat; mod lazy; -mod lazy_fiat; mod percent; mod percentiles; mod price; mod ratio; +mod rolling; mod stddev; -pub use base::*; pub use amount::*; pub use computed::*; -pub use constant::*; pub use fiat::*; pub use lazy::*; -pub use lazy_fiat::*; pub use percent::*; pub use percentiles::*; pub use price::*; pub use ratio::*; +pub use rolling::*; pub use stddev::*; diff --git a/crates/brk_computer/src/internal/from_height/percent/mod.rs b/crates/brk_computer/src/internal/from_height/percent/mod.rs index 9abd34603..0afe55ae3 100644 --- a/crates/brk_computer/src/internal/from_height/percent/mod.rs +++ b/crates/brk_computer/src/internal/from_height/percent/mod.rs @@ -1,5 +1,7 @@ mod base; mod rolling_average; +mod windows; pub use base::*; pub use rolling_average::*; +pub use windows::*; diff --git a/crates/brk_computer/src/internal/rolling/percent_windows.rs b/crates/brk_computer/src/internal/from_height/percent/windows.rs similarity index 100% rename from crates/brk_computer/src/internal/rolling/percent_windows.rs rename to crates/brk_computer/src/internal/from_height/percent/windows.rs diff --git a/crates/brk_computer/src/internal/rolling/distribution.rs b/crates/brk_computer/src/internal/from_height/rolling/distribution.rs similarity index 100% rename from crates/brk_computer/src/internal/rolling/distribution.rs rename to crates/brk_computer/src/internal/from_height/rolling/distribution.rs diff --git a/crates/brk_computer/src/internal/rolling/full.rs b/crates/brk_computer/src/internal/from_height/rolling/full.rs similarity index 100% rename from crates/brk_computer/src/internal/rolling/full.rs rename to crates/brk_computer/src/internal/from_height/rolling/full.rs diff --git a/crates/brk_computer/src/internal/rolling/mod.rs b/crates/brk_computer/src/internal/from_height/rolling/mod.rs similarity index 52% rename from crates/brk_computer/src/internal/rolling/mod.rs rename to crates/brk_computer/src/internal/from_height/rolling/mod.rs index 7a50a60a0..c00216060 100644 --- a/crates/brk_computer/src/internal/rolling/mod.rs +++ b/crates/brk_computer/src/internal/from_height/rolling/mod.rs @@ -1,11 +1,7 @@ mod distribution; mod full; -mod percent_windows; -mod amount_windows; mod windows; pub use distribution::*; pub use full::*; -pub use percent_windows::*; -pub use amount_windows::*; pub use windows::*; diff --git a/crates/brk_computer/src/internal/rolling/windows.rs b/crates/brk_computer/src/internal/from_height/rolling/windows.rs similarity index 100% rename from crates/brk_computer/src/internal/rolling/windows.rs rename to crates/brk_computer/src/internal/from_height/rolling/windows.rs diff --git a/crates/brk_computer/src/internal/mod.rs b/crates/brk_computer/src/internal/mod.rs index 96bf3278c..3d3681814 100644 --- a/crates/brk_computer/src/internal/mod.rs +++ b/crates/brk_computer/src/internal/mod.rs @@ -1,25 +1,21 @@ mod aggregate; mod algo; +mod amount; mod containers; mod db_utils; -mod derived; mod from_height; mod from_tx; mod indexes; -mod rolling; mod traits; mod transform; -mod amount; pub(crate) use aggregate::*; pub(crate) use algo::*; +pub(crate) use amount::*; pub(crate) use containers::*; pub(crate) use db_utils::*; -pub(crate) use derived::*; pub(crate) use from_height::*; pub(crate) use from_tx::*; pub(crate) use indexes::*; -pub(crate) use rolling::*; pub(crate) use traits::*; pub use transform::*; -pub(crate) use amount::*;