computer: renames

This commit is contained in:
nym21
2026-01-09 23:27:09 +01:00
parent 85570c73cb
commit 5f4fc646f5
71 changed files with 3900 additions and 3023 deletions
Generated
+3 -3
View File
@@ -2761,7 +2761,7 @@ dependencies = [
[[package]]
name = "rawdb"
version = "0.5.6"
version = "0.5.7"
dependencies = [
"libc",
"log",
@@ -3702,7 +3702,7 @@ checksum = "8f54a172d0620933a27a4360d3db3e2ae0dd6cceae9730751a036bbf182c4b23"
[[package]]
name = "vecdb"
version = "0.5.6"
version = "0.5.7"
dependencies = [
"ctrlc",
"log",
@@ -3721,7 +3721,7 @@ dependencies = [
[[package]]
name = "vecdb_derive"
version = "0.5.6"
version = "0.5.7"
dependencies = [
"quote",
"syn",
+244 -244
View File
@@ -3073,38 +3073,6 @@ impl<T: DeserializeOwned> ClassAveragePricePattern<T> {
}
}
/// Pattern struct for repeated tree structure.
pub struct RelativePattern {
pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1<StoredF32>,
pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1<StoredF32>,
pub nupl: MetricPattern1<StoredF32>,
pub supply_in_loss_rel_to_circulating_supply: MetricPattern1<StoredF64>,
pub supply_in_loss_rel_to_own_supply: MetricPattern1<StoredF64>,
pub supply_in_profit_rel_to_circulating_supply: MetricPattern1<StoredF64>,
pub supply_in_profit_rel_to_own_supply: MetricPattern1<StoredF64>,
pub supply_rel_to_circulating_supply: MetricPattern4<StoredF64>,
pub unrealized_loss_rel_to_market_cap: MetricPattern1<StoredF32>,
pub unrealized_profit_rel_to_market_cap: MetricPattern1<StoredF32>,
}
impl RelativePattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")),
net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")),
nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")),
supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")),
supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")),
supply_in_profit_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")),
supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")),
supply_rel_to_circulating_supply: MetricPattern4::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")),
unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")),
unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct RelativePattern2 {
pub neg_unrealized_loss_rel_to_own_market_cap: MetricPattern1<StoredF32>,
@@ -3137,6 +3105,38 @@ impl RelativePattern2 {
}
}
/// Pattern struct for repeated tree structure.
pub struct RelativePattern {
pub neg_unrealized_loss_rel_to_market_cap: MetricPattern1<StoredF32>,
pub net_unrealized_pnl_rel_to_market_cap: MetricPattern1<StoredF32>,
pub nupl: MetricPattern1<StoredF32>,
pub supply_in_loss_rel_to_circulating_supply: MetricPattern1<StoredF64>,
pub supply_in_loss_rel_to_own_supply: MetricPattern1<StoredF64>,
pub supply_in_profit_rel_to_circulating_supply: MetricPattern1<StoredF64>,
pub supply_in_profit_rel_to_own_supply: MetricPattern1<StoredF64>,
pub supply_rel_to_circulating_supply: MetricPattern4<StoredF64>,
pub unrealized_loss_rel_to_market_cap: MetricPattern1<StoredF32>,
pub unrealized_profit_rel_to_market_cap: MetricPattern1<StoredF32>,
}
impl RelativePattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
neg_unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "neg_unrealized_loss_rel_to_market_cap")),
net_unrealized_pnl_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "net_unrealized_pnl_rel_to_market_cap")),
nupl: MetricPattern1::new(client.clone(), _m(&acc, "nupl")),
supply_in_loss_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_circulating_supply")),
supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_loss_rel_to_own_supply")),
supply_in_profit_rel_to_circulating_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_circulating_supply")),
supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "supply_in_profit_rel_to_own_supply")),
supply_rel_to_circulating_supply: MetricPattern4::new(client.clone(), _m(&acc, "supply_rel_to_circulating_supply")),
unrealized_loss_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_loss_rel_to_market_cap")),
unrealized_profit_rel_to_market_cap: MetricPattern1::new(client.clone(), _m(&acc, "unrealized_profit_rel_to_market_cap")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct AddrCountPattern {
pub all: MetricPattern1<StoredU64>,
@@ -3167,36 +3167,6 @@ impl AddrCountPattern {
}
}
/// Pattern struct for repeated tree structure.
pub struct OhlcPattern<T> {
pub dateindex: MetricPattern7<T>,
pub decade: MetricPattern8<T>,
pub difficultyepoch: MetricPattern9<T>,
pub height: MetricPattern12<T>,
pub month: MetricPattern14<T>,
pub quarter: MetricPattern26<T>,
pub semester: MetricPattern27<T>,
pub week: MetricPattern30<T>,
pub year: MetricPattern31<T>,
}
impl<T: DeserializeOwned> OhlcPattern<T> {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
dateindex: MetricPattern7::new(client.clone(), acc.clone()),
decade: MetricPattern8::new(client.clone(), acc.clone()),
difficultyepoch: MetricPattern9::new(client.clone(), acc.clone()),
height: MetricPattern12::new(client.clone(), acc.clone()),
month: MetricPattern14::new(client.clone(), acc.clone()),
quarter: MetricPattern26::new(client.clone(), acc.clone()),
semester: MetricPattern27::new(client.clone(), acc.clone()),
week: MetricPattern30::new(client.clone(), acc.clone()),
year: MetricPattern31::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct FeeRatePattern<T> {
pub average: MetricPattern1<T>,
@@ -3227,6 +3197,36 @@ impl<T: DeserializeOwned> FeeRatePattern<T> {
}
}
/// Pattern struct for repeated tree structure.
pub struct OhlcPattern<T> {
pub dateindex: MetricPattern7<T>,
pub decade: MetricPattern8<T>,
pub difficultyepoch: MetricPattern9<T>,
pub height: MetricPattern12<T>,
pub month: MetricPattern14<T>,
pub quarter: MetricPattern26<T>,
pub semester: MetricPattern27<T>,
pub week: MetricPattern30<T>,
pub year: MetricPattern31<T>,
}
impl<T: DeserializeOwned> OhlcPattern<T> {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
dateindex: MetricPattern7::new(client.clone(), acc.clone()),
decade: MetricPattern8::new(client.clone(), acc.clone()),
difficultyepoch: MetricPattern9::new(client.clone(), acc.clone()),
height: MetricPattern12::new(client.clone(), acc.clone()),
month: MetricPattern14::new(client.clone(), acc.clone()),
quarter: MetricPattern26::new(client.clone(), acc.clone()),
semester: MetricPattern27::new(client.clone(), acc.clone()),
week: MetricPattern30::new(client.clone(), acc.clone()),
year: MetricPattern31::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct _0satsPattern {
pub activity: ActivityPattern2,
@@ -3255,6 +3255,32 @@ impl _0satsPattern {
}
}
/// Pattern struct for repeated tree structure.
pub struct _0satsPattern2 {
pub activity: ActivityPattern2,
pub cost_basis: CostBasisPattern,
pub outputs: OutputsPattern,
pub realized: RealizedPattern,
pub relative: RelativePattern4,
pub supply: SupplyPattern2,
pub unrealized: UnrealizedPattern,
}
impl _0satsPattern2 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
activity: ActivityPattern2::new(client.clone(), acc.clone()),
cost_basis: CostBasisPattern::new(client.clone(), acc.clone()),
outputs: OutputsPattern::new(client.clone(), acc.clone()),
realized: RealizedPattern::new(client.clone(), acc.clone()),
relative: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")),
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct UnrealizedPattern {
pub neg_unrealized_loss: MetricPattern1<Dollars>,
@@ -3307,6 +3333,32 @@ impl _100btcPattern {
}
}
/// Pattern struct for repeated tree structure.
pub struct _10yTo12yPattern {
pub activity: ActivityPattern2,
pub cost_basis: CostBasisPattern2,
pub outputs: OutputsPattern,
pub realized: RealizedPattern2,
pub relative: RelativePattern2,
pub supply: SupplyPattern2,
pub unrealized: UnrealizedPattern,
}
impl _10yTo12yPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
activity: ActivityPattern2::new(client.clone(), acc.clone()),
cost_basis: CostBasisPattern2::new(client.clone(), acc.clone()),
outputs: OutputsPattern::new(client.clone(), acc.clone()),
realized: RealizedPattern2::new(client.clone(), acc.clone()),
relative: RelativePattern2::new(client.clone(), acc.clone()),
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct _10yPattern {
pub activity: ActivityPattern2,
@@ -3359,62 +3411,10 @@ impl PeriodCagrPattern {
}
}
/// Pattern struct for repeated tree structure.
pub struct _0satsPattern2 {
pub activity: ActivityPattern2,
pub cost_basis: CostBasisPattern,
pub outputs: OutputsPattern,
pub realized: RealizedPattern,
pub relative: RelativePattern4,
pub supply: SupplyPattern2,
pub unrealized: UnrealizedPattern,
}
impl _0satsPattern2 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
activity: ActivityPattern2::new(client.clone(), acc.clone()),
cost_basis: CostBasisPattern::new(client.clone(), acc.clone()),
outputs: OutputsPattern::new(client.clone(), acc.clone()),
realized: RealizedPattern::new(client.clone(), acc.clone()),
relative: RelativePattern4::new(client.clone(), _m(&acc, "supply_in")),
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct _10yTo12yPattern {
pub activity: ActivityPattern2,
pub cost_basis: CostBasisPattern2,
pub outputs: OutputsPattern,
pub realized: RealizedPattern2,
pub relative: RelativePattern2,
pub supply: SupplyPattern2,
pub unrealized: UnrealizedPattern,
}
impl _10yTo12yPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
activity: ActivityPattern2::new(client.clone(), acc.clone()),
cost_basis: CostBasisPattern2::new(client.clone(), acc.clone()),
outputs: OutputsPattern::new(client.clone(), acc.clone()),
realized: RealizedPattern2::new(client.clone(), acc.clone()),
relative: RelativePattern2::new(client.clone(), acc.clone()),
supply: SupplyPattern2::new(client.clone(), _m(&acc, "supply")),
unrealized: UnrealizedPattern::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct BitcoinPattern<T> {
pub average: MetricPattern2<T>,
pub cumulative: MetricPattern1<T>,
pub cumulative: MetricPattern2<T>,
pub height: MetricPattern12<T>,
pub max: MetricPattern2<T>,
pub min: MetricPattern2<T>,
@@ -3427,7 +3427,7 @@ impl<T: DeserializeOwned> BitcoinPattern<T> {
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
average: MetricPattern2::new(client.clone(), _m(&acc, "average")),
cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")),
cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")),
height: MetricPattern12::new(client.clone(), acc.clone()),
max: MetricPattern2::new(client.clone(), _m(&acc, "max")),
min: MetricPattern2::new(client.clone(), _m(&acc, "min")),
@@ -3439,24 +3439,24 @@ impl<T: DeserializeOwned> BitcoinPattern<T> {
/// Pattern struct for repeated tree structure.
pub struct SizePattern<T> {
pub average: MetricPattern2<T>,
pub average: MetricPattern1<T>,
pub cumulative: MetricPattern1<T>,
pub max: MetricPattern2<T>,
pub min: MetricPattern2<T>,
pub max: MetricPattern1<T>,
pub min: MetricPattern1<T>,
pub percentiles: PercentilesPattern<T>,
pub sum: MetricPattern2<T>,
pub sum: MetricPattern1<T>,
}
impl<T: DeserializeOwned> SizePattern<T> {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
average: MetricPattern2::new(client.clone(), _m(&acc, "average")),
average: MetricPattern1::new(client.clone(), _m(&acc, "average")),
cumulative: MetricPattern1::new(client.clone(), _m(&acc, "cumulative")),
max: MetricPattern2::new(client.clone(), _m(&acc, "max")),
min: MetricPattern2::new(client.clone(), _m(&acc, "min")),
max: MetricPattern1::new(client.clone(), _m(&acc, "max")),
min: MetricPattern1::new(client.clone(), _m(&acc, "min")),
percentiles: PercentilesPattern::new(client.clone(), acc.clone()),
sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")),
sum: MetricPattern1::new(client.clone(), _m(&acc, "sum")),
}
}
}
@@ -3525,26 +3525,6 @@ impl DateindexPattern2 {
}
}
/// Pattern struct for repeated tree structure.
pub struct SplitPattern2<T> {
pub close: MetricPattern1<T>,
pub high: HighPattern<T>,
pub low: HighPattern<T>,
pub open: MetricPattern1<T>,
}
impl<T: DeserializeOwned> SplitPattern2<T> {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
close: MetricPattern1::new(client.clone(), _m(&acc, "close")),
high: HighPattern::new(client.clone(), _m(&acc, "high")),
low: HighPattern::new(client.clone(), _m(&acc, "low")),
open: MetricPattern1::new(client.clone(), _m(&acc, "open")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct HighPattern<T> {
pub dateindex: MetricPattern7<T>,
@@ -3565,6 +3545,26 @@ impl<T: DeserializeOwned> HighPattern<T> {
}
}
/// Pattern struct for repeated tree structure.
pub struct SplitPattern2<T> {
pub close: MetricPattern1<T>,
pub high: HighPattern<T>,
pub low: HighPattern<T>,
pub open: MetricPattern1<T>,
}
impl<T: DeserializeOwned> SplitPattern2<T> {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
close: MetricPattern1::new(client.clone(), _m(&acc, "close")),
high: HighPattern::new(client.clone(), _m(&acc, "high")),
low: HighPattern::new(client.clone(), _m(&acc, "low")),
open: MetricPattern1::new(client.clone(), _m(&acc, "open")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct _24hCoinbaseSumPattern {
pub bitcoin: MetricPattern12<Bitcoin>,
@@ -3584,37 +3584,19 @@ impl _24hCoinbaseSumPattern {
}
/// Pattern struct for repeated tree structure.
pub struct SegwitAdoptionPattern {
pub cumulative: MetricPattern2<StoredF32>,
pub height: MetricPattern12<StoredF32>,
pub sum: MetricPattern2<StoredF32>,
pub struct CoinbasePattern {
pub bitcoin: BitcoinPattern<Bitcoin>,
pub dollars: BitcoinPattern<Dollars>,
pub sats: BitcoinPattern<Sats>,
}
impl SegwitAdoptionPattern {
impl CoinbasePattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")),
height: MetricPattern12::new(client.clone(), acc.clone()),
sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct CostBasisPattern2 {
pub max: MetricPattern1<Dollars>,
pub min: MetricPattern1<Dollars>,
pub percentiles: PercentilesPattern2,
}
impl CostBasisPattern2 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")),
min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")),
percentiles: PercentilesPattern2::new(client.clone(), _m(&acc, "cost_basis")),
bitcoin: BitcoinPattern::new(client.clone(), _m(&acc, "btc")),
dollars: BitcoinPattern::new(client.clone(), _m(&acc, "usd")),
sats: BitcoinPattern::new(client.clone(), acc.clone()),
}
}
}
@@ -3638,83 +3620,37 @@ impl UnclaimedRewardsPattern {
}
/// Pattern struct for repeated tree structure.
pub struct CoinbasePattern {
pub bitcoin: BitcoinPattern<Bitcoin>,
pub dollars: BitcoinPattern<Dollars>,
pub sats: BitcoinPattern<Sats>,
}
impl CoinbasePattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
bitcoin: BitcoinPattern::new(client.clone(), _m(&acc, "btc")),
dollars: BitcoinPattern::new(client.clone(), _m(&acc, "usd")),
sats: BitcoinPattern::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct RelativePattern4 {
pub supply_in_loss_rel_to_own_supply: MetricPattern1<StoredF64>,
pub supply_in_profit_rel_to_own_supply: MetricPattern1<StoredF64>,
}
impl RelativePattern4 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "loss_rel_to_own_supply")),
supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "profit_rel_to_own_supply")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct _1dReturns1mSdPattern {
pub sd: MetricPattern4<StoredF32>,
pub sma: MetricPattern4<StoredF32>,
}
impl _1dReturns1mSdPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
sd: MetricPattern4::new(client.clone(), _m(&acc, "sd")),
sma: MetricPattern4::new(client.clone(), _m(&acc, "sma")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct CostBasisPattern {
pub struct CostBasisPattern2 {
pub max: MetricPattern1<Dollars>,
pub min: MetricPattern1<Dollars>,
pub percentiles: PercentilesPattern2,
}
impl CostBasisPattern {
impl CostBasisPattern2 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")),
min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")),
percentiles: PercentilesPattern2::new(client.clone(), _m(&acc, "cost_basis")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct SupplyPattern2 {
pub halved: _24hCoinbaseSumPattern,
pub total: _24hCoinbaseSumPattern,
pub struct SegwitAdoptionPattern {
pub cumulative: MetricPattern2<StoredF32>,
pub height: MetricPattern12<StoredF32>,
pub sum: MetricPattern2<StoredF32>,
}
impl SupplyPattern2 {
impl SegwitAdoptionPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
halved: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "half")),
total: _24hCoinbaseSumPattern::new(client.clone(), acc.clone()),
cumulative: MetricPattern2::new(client.clone(), _m(&acc, "cumulative")),
height: MetricPattern12::new(client.clone(), acc.clone()),
sum: MetricPattern2::new(client.clone(), _m(&acc, "sum")),
}
}
}
@@ -3735,6 +3671,70 @@ impl SatsPattern {
}
}
/// Pattern struct for repeated tree structure.
pub struct SupplyPattern2 {
pub halved: _24hCoinbaseSumPattern,
pub total: _24hCoinbaseSumPattern,
}
impl SupplyPattern2 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
halved: _24hCoinbaseSumPattern::new(client.clone(), _m(&acc, "half")),
total: _24hCoinbaseSumPattern::new(client.clone(), acc.clone()),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct CostBasisPattern {
pub max: MetricPattern1<Dollars>,
pub min: MetricPattern1<Dollars>,
}
impl CostBasisPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
max: MetricPattern1::new(client.clone(), _m(&acc, "max_cost_basis")),
min: MetricPattern1::new(client.clone(), _m(&acc, "min_cost_basis")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct _1dReturns1mSdPattern {
pub sd: MetricPattern4<StoredF32>,
pub sma: MetricPattern4<StoredF32>,
}
impl _1dReturns1mSdPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
sd: MetricPattern4::new(client.clone(), _m(&acc, "sd")),
sma: MetricPattern4::new(client.clone(), _m(&acc, "sma")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct RelativePattern4 {
pub supply_in_loss_rel_to_own_supply: MetricPattern1<StoredF64>,
pub supply_in_profit_rel_to_own_supply: MetricPattern1<StoredF64>,
}
impl RelativePattern4 {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
supply_in_loss_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "loss_rel_to_own_supply")),
supply_in_profit_rel_to_own_supply: MetricPattern1::new(client.clone(), _m(&acc, "profit_rel_to_own_supply")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct BlockCountPattern<T> {
pub cumulative: MetricPattern1<T>,
@@ -3751,20 +3751,6 @@ impl<T: DeserializeOwned> BlockCountPattern<T> {
}
}
/// Pattern struct for repeated tree structure.
pub struct RealizedPriceExtraPattern {
pub ratio: MetricPattern4<StoredF32>,
}
impl RealizedPriceExtraPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
ratio: MetricPattern4::new(client.clone(), _m(&acc, "ratio")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct OutputsPattern {
pub utxo_count: MetricPattern1<StoredU64>,
@@ -3779,16 +3765,30 @@ impl OutputsPattern {
}
}
/// Pattern struct for repeated tree structure.
pub struct RealizedPriceExtraPattern {
pub ratio: MetricPattern4<StoredF32>,
}
impl RealizedPriceExtraPattern {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
ratio: MetricPattern4::new(client.clone(), _m(&acc, "ratio")),
}
}
}
/// Pattern struct for repeated tree structure.
pub struct EmptyPattern<T> {
pub identity: MetricPattern18<T>,
pub identity: MetricPattern25<T>,
}
impl<T: DeserializeOwned> EmptyPattern<T> {
/// Create a new pattern node with accumulated metric name.
pub fn new(client: Arc<BrkClientBase>, acc: String) -> Self {
Self {
identity: MetricPattern18::new(client.clone(), acc.clone()),
identity: MetricPattern25::new(client.clone(), acc.clone()),
}
}
}
@@ -6,7 +6,7 @@ use vecdb::{Database, IterableCloneableVec};
use super::Vecs;
use crate::{
indexes,
internal::{ComputedBlockLast, ComputedBlockSum, ComputedDateLast, DerivedComputedBlockLast},
internal::{ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedDerivedBlockLast},
};
impl Vecs {
@@ -106,7 +106,7 @@ impl Vecs {
indexes,
)?,
// Derived from external indexer data - no height storage needed
difficulty: DerivedComputedBlockLast::forced_import(
difficulty: ComputedDerivedBlockLast::forced_import(
db,
"difficulty",
indexer.vecs.blocks.difficulty.boxed_clone(),
@@ -2,7 +2,7 @@ use brk_traversable::Traversable;
use brk_types::{StoredF32, StoredF64};
use crate::internal::{
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, DerivedComputedBlockLast,
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedDerivedBlockLast,
};
/// Mining-related metrics: hash rate, hash price, hash value, difficulty
@@ -24,7 +24,7 @@ pub struct Vecs {
pub hash_value_phs_min: ComputedBlockLast<StoredF32>,
pub hash_value_rebound: ComputedBlockLast<StoredF32>,
/// Derived from indexer - no height storage needed
pub difficulty: DerivedComputedBlockLast<StoredF64>,
pub difficulty: ComputedDerivedBlockLast<StoredF64>,
pub difficulty_as_hash: ComputedBlockLast<StoredF32>,
pub difficulty_adjustment: ComputedBlockSum<StoredF32>,
}
@@ -4,7 +4,7 @@ use brk_types::{Height, StoredU64, Version};
use vecdb::{Database, IterableCloneableVec, VecIndex};
use super::Vecs;
use crate::{indexes, internal::{DerivedComputedBlockFull, LazyComputedBlockFull}};
use crate::{indexes, internal::{ComputedDerivedBlockFull, LazyComputedBlockFull}};
impl Vecs {
pub fn forced_import(
@@ -26,7 +26,7 @@ impl Vecs {
.map(|w| StoredU64::from(w.to_vbytes_floor()))
},
)?,
size: DerivedComputedBlockFull::forced_import(
size: ComputedDerivedBlockFull::forced_import(
db,
"block_size",
indexer.vecs.blocks.total_size.boxed_clone(),
+2 -2
View File
@@ -1,10 +1,10 @@
use brk_traversable::Traversable;
use brk_types::{StoredU64, Weight};
use crate::internal::{DerivedComputedBlockFull, LazyComputedBlockFull};
use crate::internal::{ComputedDerivedBlockFull, LazyComputedBlockFull};
#[derive(Clone, Traversable)]
pub struct Vecs {
pub vbytes: LazyComputedBlockFull<StoredU64, Weight>,
pub size: DerivedComputedBlockFull<StoredU64>,
pub size: ComputedDerivedBlockFull<StoredU64>,
}
@@ -4,7 +4,7 @@ use brk_types::{Date, Height, Version};
use vecdb::{Database, EagerVec, ImportableVec, IterableCloneableVec, LazyVecFrom1, VecIndex};
use super::Vecs;
use crate::{indexes, internal::DerivedComputedBlockFirst};
use crate::{indexes, internal::ComputedDerivedBlockFirst};
impl Vecs {
pub fn forced_import(
@@ -31,7 +31,7 @@ impl Vecs {
|height: Height, timestamp_iter| timestamp_iter.get(height).map(Date::from),
),
timestamp_fixed: height_to_timestamp_fixed,
timestamp: DerivedComputedBlockFirst::forced_import(
timestamp: ComputedDerivedBlockFirst::forced_import(
db,
"timestamp",
indexer.vecs.blocks.timestamp.boxed_clone(),
+2 -2
View File
@@ -2,7 +2,7 @@ use brk_traversable::Traversable;
use brk_types::{Date, Height, Timestamp};
use vecdb::{EagerVec, LazyVecFrom1, PcoVec};
use crate::internal::DerivedComputedBlockFirst;
use crate::internal::ComputedDerivedBlockFirst;
/// Timestamp and date metrics for blocks
#[derive(Clone, Traversable)]
@@ -10,5 +10,5 @@ pub struct Vecs {
pub date: LazyVecFrom1<Height, Date, Height, Timestamp>,
pub date_fixed: LazyVecFrom1<Height, Date, Height, Timestamp>,
pub timestamp_fixed: EagerVec<PcoVec<Height, Timestamp>>,
pub timestamp: DerivedComputedBlockFirst<Timestamp>,
pub timestamp: ComputedDerivedBlockFirst<Timestamp>,
}
@@ -6,7 +6,7 @@ use vecdb::{Database, IterableCloneableVec};
use super::Vecs;
use crate::{
indexes,
internal::{DerivedComputedBlockFull, LazyBlockFull, WeightToFullness},
internal::{ComputedDerivedBlockFull, LazyBlockFull, WeightToFullness},
};
impl Vecs {
@@ -16,7 +16,7 @@ impl Vecs {
indexer: &Indexer,
indexes: &indexes::Vecs,
) -> Result<Self> {
let weight = DerivedComputedBlockFull::forced_import(
let weight = ComputedDerivedBlockFull::forced_import(
db,
"block_weight",
indexer.vecs.blocks.weight.boxed_clone(),
@@ -1,10 +1,10 @@
use brk_traversable::Traversable;
use brk_types::{StoredF32, Weight};
use crate::internal::{DerivedComputedBlockFull, LazyBlockFull};
use crate::internal::{ComputedDerivedBlockFull, LazyBlockFull};
#[derive(Clone, Traversable)]
pub struct Vecs {
pub weight: DerivedComputedBlockFull<Weight>,
pub weight: ComputedDerivedBlockFull<Weight>,
pub fullness: LazyBlockFull<StoredF32, Weight>,
}
@@ -10,7 +10,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedComputedBlockFull, NumericValue};
use crate::internal::{ComputedVecValue, ComputedDerivedBlockFull, NumericValue};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -22,7 +22,7 @@ where
pub height: EagerVec<PcoVec<Height, T>>,
#[deref]
#[deref_mut]
pub rest: DerivedComputedBlockFull<T>,
pub rest: ComputedDerivedBlockFull<T>,
}
const VERSION: Version = Version::ZERO;
@@ -41,7 +41,7 @@ where
let height: EagerVec<PcoVec<Height, T>> = EagerVec::forced_import(db, name, v)?;
let rest = DerivedComputedBlockFull::forced_import(
let rest = ComputedDerivedBlockFull::forced_import(
db,
name,
height.boxed_clone(),
@@ -10,7 +10,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedComputedBlockLast, NumericValue};
use crate::internal::{ComputedVecValue, ComputedDerivedBlockLast, NumericValue};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -22,7 +22,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedComputedBlockLast<T>,
pub rest: ComputedDerivedBlockLast<T>,
}
const VERSION: Version = Version::ZERO;
@@ -42,7 +42,7 @@ where
let height: EagerVec<PcoVec<Height, T>> = EagerVec::forced_import(db, name, v)?;
let rest =
DerivedComputedBlockLast::forced_import(db, name, height.boxed_clone(), v, indexes)?;
ComputedDerivedBlockLast::forced_import(db, name, height.boxed_clone(), v, indexes)?;
Ok(Self { height, rest })
}
@@ -14,7 +14,7 @@ use vecdb::{Database, Exit, IterableCloneableVec, LazyVecFrom2};
use crate::{indexes, ComputeIndexes};
use crate::internal::{ComputedVecValue, DerivedComputedBlockSumCum, NumericValue};
use crate::internal::{ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue};
/// Lazy binary height + stored derived block SumCum.
///
@@ -33,7 +33,7 @@ where
pub height: LazyVecFrom2<Height, T, Height, S1T, Height, S2T>,
#[deref]
#[deref_mut]
pub rest: DerivedComputedBlockSumCum<T>,
pub rest: ComputedDerivedBlockSumCum<T>,
}
const VERSION: Version = Version::ZERO;
@@ -53,7 +53,7 @@ where
) -> Result<Self> {
let v = version + VERSION;
let rest = DerivedComputedBlockSumCum::forced_import(
let rest = ComputedDerivedBlockSumCum::forced_import(
db,
name,
height.boxed_clone(),
@@ -10,7 +10,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedComputedBlockSum, NumericValue};
use crate::internal::{ComputedVecValue, ComputedDerivedBlockSum, NumericValue};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -22,7 +22,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedComputedBlockSum<T>,
pub rest: ComputedDerivedBlockSum<T>,
}
const VERSION: Version = Version::ZERO;
@@ -42,7 +42,7 @@ where
let height: EagerVec<PcoVec<Height, T>> = EagerVec::forced_import(db, name, v)?;
let rest =
DerivedComputedBlockSum::forced_import(db, name, height.boxed_clone(), v, indexes)?;
ComputedDerivedBlockSum::forced_import(db, name, height.boxed_clone(), v, indexes)?;
Ok(Self { height, rest })
}
@@ -13,7 +13,7 @@ use vecdb::{
use crate::{indexes, ComputeIndexes};
use crate::internal::{ComputedVecValue, DerivedComputedBlockSumCum, NumericValue};
use crate::internal::{ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -25,7 +25,7 @@ where
pub height: EagerVec<PcoVec<Height, T>>,
#[deref]
#[deref_mut]
pub rest: DerivedComputedBlockSumCum<T>,
pub rest: ComputedDerivedBlockSumCum<T>,
}
const VERSION: Version = Version::ZERO;
@@ -44,7 +44,7 @@ where
let height: EagerVec<PcoVec<Height, T>> = EagerVec::forced_import(db, name, v)?;
let rest = DerivedComputedBlockSumCum::forced_import(
let rest = ComputedDerivedBlockSumCum::forced_import(
db,
name,
height.boxed_clone(),
@@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedDateAverage};
use crate::internal::{ComputedVecValue, LazyPeriodsAverage};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -21,7 +21,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedDateAverage<T>,
pub rest: LazyPeriodsAverage<T>,
}
const VERSION: Version = Version::ZERO;
@@ -39,7 +39,7 @@ where
let dateindex = EagerVec::forced_import(db, name, version + VERSION)?;
Ok(Self {
rest: DerivedDateAverage::from_source(
rest: LazyPeriodsAverage::from_source(
name,
version + VERSION,
dateindex.boxed_clone(),
@@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedDateFirst};
use crate::internal::{ComputedVecValue, LazyPeriodsFirst};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -21,7 +21,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedDateFirst<T>,
pub rest: LazyPeriodsFirst<T>,
}
const VERSION: Version = Version::ZERO;
@@ -39,7 +39,7 @@ where
let dateindex = EagerVec::forced_import(db, name, version + VERSION)?;
Ok(Self {
rest: DerivedDateFirst::from_source(
rest: LazyPeriodsFirst::from_source(
name,
version + VERSION,
dateindex.boxed_clone(),
@@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, Itera
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedDateLast};
use crate::internal::{ComputedVecValue, LazyPeriodsLast};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -21,7 +21,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedDateLast<T>,
pub rest: LazyPeriodsLast<T>,
}
const VERSION: Version = Version::ZERO;
@@ -39,7 +39,7 @@ where
let dateindex = EagerVec::forced_import(db, name, version + VERSION)?;
Ok(Self {
rest: DerivedDateLast::from_source(
rest: LazyPeriodsLast::from_source(
name,
version + VERSION,
dateindex.boxed_clone(),
@@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedDateMax};
use crate::internal::{ComputedVecValue, LazyPeriodsMax};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -21,7 +21,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedDateMax<T>,
pub rest: LazyPeriodsMax<T>,
}
const VERSION: Version = Version::ZERO;
@@ -39,7 +39,7 @@ where
let dateindex = EagerVec::forced_import(db, name, version + VERSION)?;
Ok(Self {
rest: DerivedDateMax::from_source(
rest: LazyPeriodsMax::from_source(
name,
version + VERSION,
dateindex.boxed_clone(),
@@ -9,7 +9,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes};
use crate::internal::{ComputedVecValue, DerivedDateMin};
use crate::internal::{ComputedVecValue, LazyPeriodsMin};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -21,7 +21,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedDateMin<T>,
pub rest: LazyPeriodsMin<T>,
}
const VERSION: Version = Version::ZERO;
@@ -39,7 +39,7 @@ where
let dateindex = EagerVec::forced_import(db, name, version + VERSION)?;
Ok(Self {
rest: DerivedDateMin::from_source(
rest: LazyPeriodsMin::from_source(
name,
version + VERSION,
dateindex.boxed_clone(),
@@ -1,4 +1,4 @@
//! DerivedComputedBlockDistribution - dateindex storage + lazy time periods + difficultyepoch.
//! ComputedDerivedBlockDistribution - dateindex storage + lazy time periods + difficultyepoch.
use brk_error::Result;
@@ -11,26 +11,26 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec}
use crate::{
ComputeIndexes, indexes,
internal::{
ComputedVecValue, DerivedDateDistribution, Distribution, LazyDistribution, NumericValue,
ComputedVecValue, LazyPeriodsDistribution, Distribution, LazyDistribution, NumericValue,
},
};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct DerivedComputedBlockDistribution<T>
pub struct ComputedDerivedBlockDistribution<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
pub dateindex: Distribution<DateIndex, T>,
#[deref]
#[deref_mut]
pub dates: DerivedDateDistribution<T>,
pub dates: LazyPeriodsDistribution<T>,
pub difficultyepoch: LazyDistribution<DifficultyEpoch, T, Height, DifficultyEpoch>,
}
const VERSION: Version = Version::ZERO;
impl<T> DerivedComputedBlockDistribution<T>
impl<T> ComputedDerivedBlockDistribution<T>
where
T: NumericValue + JsonSchema,
{
@@ -44,7 +44,7 @@ where
let dateindex = Distribution::forced_import(db, name, version + VERSION)?;
let v = version + VERSION;
let dates = DerivedDateDistribution::from_sources(
let dates = LazyPeriodsDistribution::from_sources(
name,
v,
dateindex.average.0.boxed_clone(),
@@ -1,4 +1,4 @@
//! DerivedComputedBlockFirst - dateindex storage + difficultyepoch + lazy time periods (first value).
//! ComputedDerivedBlockFirst - dateindex storage + difficultyepoch + lazy time periods (first value).
use brk_error::Result;
@@ -10,12 +10,12 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec}
use crate::{
ComputeIndexes, indexes,
internal::{ComputedVecValue, DerivedDateFirst, FirstVec, LazyFirst, NumericValue},
internal::{ComputedVecValue, LazyPeriodsFirst, FirstVec, LazyFirst, NumericValue},
};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct DerivedComputedBlockFirst<T>
pub struct ComputedDerivedBlockFirst<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -23,13 +23,13 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub dates: DerivedDateFirst<T>,
pub dates: LazyPeriodsFirst<T>,
pub difficultyepoch: LazyFirst<DifficultyEpoch, T, Height, DifficultyEpoch>,
}
const VERSION: Version = Version::ZERO;
impl<T> DerivedComputedBlockFirst<T>
impl<T> ComputedDerivedBlockFirst<T>
where
T: NumericValue + JsonSchema,
{
@@ -44,7 +44,7 @@ where
let v = version + VERSION;
Ok(Self {
dates: DerivedDateFirst::from_source(name, v, dateindex.0.boxed_clone(), indexes),
dates: LazyPeriodsFirst::from_source(name, v, dateindex.0.boxed_clone(), indexes),
difficultyepoch: LazyFirst::from_source(
name,
v,
@@ -1,4 +1,4 @@
//! DerivedComputedBlockFull - height_cumulative + dateindex storage + difficultyepoch + lazy time periods.
//! ComputedDerivedBlockFull - height_cumulative + dateindex storage + difficultyepoch + lazy time periods.
use brk_error::Result;
@@ -11,14 +11,14 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec}
use crate::{
ComputeIndexes, indexes,
internal::{
ComputedVecValue, CumulativeVec, DerivedDateFull, Full, LazyFull, NumericValue,
ComputedVecValue, CumulativeVec, LazyPeriodsFull, Full, LazyFull, NumericValue,
compute_cumulative_extend,
},
};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct DerivedComputedBlockFull<T>
pub struct ComputedDerivedBlockFull<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,13 +27,13 @@ where
pub dateindex: Full<DateIndex, T>,
#[deref]
#[deref_mut]
pub dates: DerivedDateFull<T>,
pub dates: LazyPeriodsFull<T>,
pub difficultyepoch: LazyFull<DifficultyEpoch, T, Height, DifficultyEpoch>,
}
const VERSION: Version = Version::ZERO;
impl<T> DerivedComputedBlockFull<T>
impl<T> ComputedDerivedBlockFull<T>
where
T: NumericValue + JsonSchema,
{
@@ -49,7 +49,7 @@ where
let dateindex = Full::forced_import(db, name, v)?;
Ok(Self {
dates: DerivedDateFull::from_sources(
dates: LazyPeriodsFull::from_sources(
name,
v,
dateindex.distribution.average.0.boxed_clone(),
@@ -1,4 +1,4 @@
//! DerivedComputedBlockLast - dateindex storage + difficultyepoch + lazy time periods.
//! ComputedDerivedBlockLast - dateindex storage + difficultyepoch + lazy time periods.
use brk_error::Result;
@@ -10,12 +10,12 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec}
use crate::{
ComputeIndexes, indexes,
internal::{ComputedVecValue, DerivedDateLast, LastVec, LazyLast, NumericValue},
internal::{ComputedVecValue, LazyPeriodsLast, LastVec, LazyLast, NumericValue},
};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct DerivedComputedBlockLast<T>
pub struct ComputedDerivedBlockLast<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -23,13 +23,13 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub dates: DerivedDateLast<T>,
pub dates: LazyPeriodsLast<T>,
pub difficultyepoch: LazyLast<DifficultyEpoch, T, Height, DifficultyEpoch>,
}
const VERSION: Version = Version::ZERO;
impl<T> DerivedComputedBlockLast<T>
impl<T> ComputedDerivedBlockLast<T>
where
T: NumericValue + JsonSchema,
{
@@ -44,7 +44,7 @@ where
let v = version + VERSION;
Ok(Self {
dates: DerivedDateLast::from_source(name, v, dateindex.0.boxed_clone(), indexes),
dates: LazyPeriodsLast::from_source(name, v, dateindex.0.boxed_clone(), indexes),
difficultyepoch: LazyLast::from_source(
name,
v,
@@ -1,4 +1,4 @@
//! DerivedComputedBlockSum - dateindex storage + difficultyepoch + lazy time periods.
//! ComputedDerivedBlockSum - dateindex storage + difficultyepoch + lazy time periods.
use brk_error::Result;
@@ -13,25 +13,25 @@ use vecdb::{
use crate::{
ComputeIndexes, indexes,
internal::{ComputedVecValue, DerivedDateSum, LazySum, NumericValue, SumVec},
internal::{ComputedVecValue, LazyPeriodsSum, LazySum, NumericValue, SumVec},
};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct DerivedComputedBlockSum<T>
pub struct ComputedDerivedBlockSum<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
pub dateindex: SumVec<DateIndex, T>,
#[deref]
#[deref_mut]
pub dates: DerivedDateSum<T>,
pub dates: LazyPeriodsSum<T>,
pub difficultyepoch: LazySum<DifficultyEpoch, T, Height, DifficultyEpoch>,
}
const VERSION: Version = Version::ZERO;
impl<T> DerivedComputedBlockSum<T>
impl<T> ComputedDerivedBlockSum<T>
where
T: NumericValue + JsonSchema,
{
@@ -46,7 +46,7 @@ where
let v = version + VERSION;
Ok(Self {
dates: DerivedDateSum::from_source(name, v, dateindex.0.boxed_clone(), indexes),
dates: LazyPeriodsSum::from_source(name, v, dateindex.0.boxed_clone(), indexes),
difficultyepoch: LazySum::from_source_raw(
name,
v,
@@ -1,4 +1,4 @@
//! DerivedComputedBlockSumCum - aggregates derived from an external height source.
//! ComputedDerivedBlockSumCum - aggregates derived from an external height source.
use brk_error::Result;
@@ -14,14 +14,14 @@ use vecdb::{
use crate::{
ComputeIndexes, indexes,
internal::{
ComputedVecValue, CumulativeVec, DerivedDateSumCum, LazySumCum, NumericValue, SumCum,
ComputedVecValue, CumulativeVec, LazyPeriodsSumCum, LazySumCum, NumericValue, SumCum,
compute_cumulative_extend,
},
};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct DerivedComputedBlockSumCum<T>
pub struct ComputedDerivedBlockSumCum<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -30,13 +30,13 @@ where
pub dateindex: SumCum<DateIndex, T>,
#[deref]
#[deref_mut]
pub dates: DerivedDateSumCum<T>,
pub dates: LazyPeriodsSumCum<T>,
pub difficultyepoch: LazySumCum<DifficultyEpoch, T, Height, DifficultyEpoch>,
}
const VERSION: Version = Version::ZERO;
impl<T> DerivedComputedBlockSumCum<T>
impl<T> ComputedDerivedBlockSumCum<T>
where
T: NumericValue + JsonSchema,
{
@@ -52,7 +52,7 @@ where
let height_cumulative = CumulativeVec::forced_import(db, name, v)?;
let dateindex = SumCum::forced_import_sum_raw(db, name, v)?;
let dates = DerivedDateSumCum::from_sources(
let dates = LazyPeriodsSumCum::from_sources(
name,
v,
dateindex.sum.0.boxed_clone(),
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateAverage<T>
pub struct LazyPeriodsAverage<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateAverage<T>
impl<T> LazyPeriodsAverage<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateDistribution<T>
pub struct LazyPeriodsDistribution<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateDistribution<T>
impl<T> LazyPeriodsDistribution<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateFirst<T>
pub struct LazyPeriodsFirst<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateFirst<T>
impl<T> LazyPeriodsFirst<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateFull<T>
pub struct LazyPeriodsFull<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateFull<T>
impl<T> LazyPeriodsFull<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateLast<T>
pub struct LazyPeriodsLast<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateLast<T>
impl<T> LazyPeriodsLast<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateMax<T>
pub struct LazyPeriodsMax<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateMax<T>
impl<T> LazyPeriodsMax<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateMin<T>
pub struct LazyPeriodsMin<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateMin<T>
impl<T> LazyPeriodsMin<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateSum<T>
pub struct LazyPeriodsSum<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateSum<T>
impl<T> LazyPeriodsSum<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -13,7 +13,7 @@ use crate::internal::ComputedVecValue;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct DerivedDateSumCum<T>
pub struct LazyPeriodsSumCum<T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
{
@@ -27,7 +27,7 @@ where
const VERSION: Version = Version::ZERO;
impl<T> DerivedDateSumCum<T>
impl<T> LazyPeriodsSumCum<T>
where
T: ComputedVecValue + JsonSchema + 'static,
{
@@ -16,7 +16,7 @@ use vecdb::{CollectableVec, Database, Exit, IterableCloneableVec};
use crate::{
ComputeIndexes, indexes,
internal::{
ComputedVecValue, DerivedDateDistribution, Distribution, LazyDistribution, MinMaxAverage,
ComputedVecValue, LazyPeriodsDistribution, Distribution, LazyDistribution, MinMaxAverage,
NumericValue,
},
};
@@ -33,7 +33,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub dates: DerivedDateDistribution<T>,
pub dates: LazyPeriodsDistribution<T>,
}
const VERSION: Version = Version::ZERO;
@@ -62,7 +62,7 @@ where
indexes.difficultyepoch.identity.boxed_clone(),
);
let dates = DerivedDateDistribution::from_sources(
let dates = LazyPeriodsDistribution::from_sources(
name,
v,
dateindex.average.0.boxed_clone(),
@@ -11,7 +11,7 @@ use vecdb::{CollectableVec, Database, Exit, IterableCloneableVec};
use crate::{
indexes, ComputeIndexes,
internal::{ComputedVecValue, DerivedDateFull, Full, LazyFull, NumericValue, Stats},
internal::{ComputedVecValue, LazyPeriodsFull, Full, LazyFull, NumericValue, Stats},
};
/// Aggregates from TxIndex to height/dateindex with full stats.
@@ -27,7 +27,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub dates: DerivedDateFull<T>,
pub dates: LazyPeriodsFull<T>,
}
const VERSION: Version = Version::ZERO;
@@ -58,7 +58,7 @@ where
indexes.difficultyepoch.identity.boxed_clone(),
);
let dates = DerivedDateFull::from_sources(
let dates = LazyPeriodsFull::from_sources(
name,
v,
dateindex.average.0.boxed_clone(),
@@ -8,7 +8,7 @@ use vecdb::{BinaryTransform, IterableBoxedVec, LazyVecFrom2};
use crate::internal::{ComputedBlockFull, ComputedVecValue, DerivedTxFull, NumericValue};
use super::super::derived_block::LazyDerivedBlock2SumCum;
use super::super::derived_block::LazyBinaryDerivedBlockSumCum;
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -22,7 +22,7 @@ where
pub height: LazyVecFrom2<Height, T, Height, S1T, Height, S2T>,
#[deref]
#[deref_mut]
pub rest: LazyDerivedBlock2SumCum<T, S1T, S2T>,
pub rest: LazyBinaryDerivedBlockSumCum<T, S1T, S2T>,
}
const VERSION: Version = Version::ZERO;
@@ -45,7 +45,7 @@ where
Self {
height: LazyVecFrom2::transformed::<F>(name, v, height_source1, height_source2),
rest: LazyDerivedBlock2SumCum::from_derived_full::<F, _, _, _, _>(
rest: LazyBinaryDerivedBlockSumCum::from_derived_full::<F, _, _, _, _>(
name,
v,
&source1.dateindex.sum_cum,
@@ -8,10 +8,10 @@ use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom
use crate::internal::{
ComputedBlockLast, ComputedBlockSumCum, ComputedHeightDateLast, ComputedVecValue,
DerivedDateLast, LazyBinaryDateLast, LazyTransform2Last, NumericValue,
LazyPeriodsLast, LazyBinaryDateLast, LazyBinaryTransformLast, NumericValue,
};
use super::super::derived_block::LazyDerivedBlock2Last;
use super::super::derived_block::LazyBinaryDerivedBlockLast;
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -24,7 +24,7 @@ where
pub height: LazyVecFrom2<Height, T, Height, S1T, Height, S2T>,
#[deref]
#[deref_mut]
pub rest: LazyDerivedBlock2Last<T, S1T, S2T>,
pub rest: LazyBinaryDerivedBlockLast<T, S1T, S2T>,
}
const VERSION: Version = Version::ZERO;
@@ -54,7 +54,7 @@ where
source1.height_cumulative.0.boxed_clone(),
source2.height_cumulative.0.boxed_clone(),
),
rest: LazyDerivedBlock2Last::from_computed_sum_cum::<F>(name, v, source1, source2),
rest: LazyBinaryDerivedBlockLast::from_computed_sum_cum::<F>(name, v, source1, source2),
}
}
@@ -77,7 +77,7 @@ where
source1.height.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2Last::from_computed_last::<F>(name, v, source1, source2),
rest: LazyBinaryDerivedBlockLast::from_computed_last::<F>(name, v, source1, source2),
}
}
@@ -100,7 +100,7 @@ where
source1.height.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2Last::from_computed_height_date_last::<F>(
rest: LazyBinaryDerivedBlockLast::from_computed_height_date_last::<F>(
name, v, source1, source2,
),
}
@@ -128,14 +128,14 @@ where
source1.height.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2Last {
rest: LazyBinaryDerivedBlockLast {
dates: LazyBinaryDateLast::from_computed_and_binary_last::<F, _, _>(
name,
v,
&source1.rest,
&source2.rest.dates,
),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.difficultyepoch.0.boxed_clone(),
@@ -165,7 +165,7 @@ where
source1.height.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2Last::from_computed_height_date_and_block_last::<F>(
rest: LazyBinaryDerivedBlockLast::from_computed_height_date_and_block_last::<F>(
name, v, source1, source2,
),
}
@@ -193,14 +193,14 @@ where
source1.height.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2Last {
rest: LazyBinaryDerivedBlockLast {
dates: LazyBinaryDateLast::from_binary_and_block_last::<F, _, _>(
name,
v,
&source1.rest.dates,
source2,
),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.rest.difficultyepoch.boxed_clone(),
@@ -233,14 +233,14 @@ where
source1.height.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2Last {
rest: LazyBinaryDerivedBlockLast {
dates: LazyBinaryDateLast::from_both_binary_last::<F, _, _, _, _>(
name,
v,
&source1.rest.dates,
&source2.rest.dates,
),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.rest.difficultyepoch.boxed_clone(),
@@ -262,15 +262,15 @@ where
difficultyepoch_source1: IterableBoxedVec<DifficultyEpoch, S1T>,
difficultyepoch_source2: IterableBoxedVec<DifficultyEpoch, S2T>,
dateindex_source1: IterableBoxedVec<DateIndex, S1T>,
dates_source1: &DerivedDateLast<S1T>,
dates_source1: &LazyPeriodsLast<S1T>,
dateindex_source2: IterableBoxedVec<DateIndex, S2T>,
dates_source2: &DerivedDateLast<S2T>,
dates_source2: &LazyPeriodsLast<S2T>,
) -> Self {
let v = version + VERSION;
Self {
height: LazyVecFrom2::transformed::<F>(name, v, height_source1, height_source2),
rest: LazyDerivedBlock2Last {
rest: LazyBinaryDerivedBlockLast {
dates: LazyBinaryDateLast::from_both_derived_last::<F>(
name,
v,
@@ -279,7 +279,7 @@ where
dateindex_source2,
dates_source2,
),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
difficultyepoch_source1,
@@ -6,9 +6,9 @@ use derive_more::{Deref, DerefMut};
use schemars::JsonSchema;
use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2};
use crate::internal::{ComputedBlockSum, ComputedVecValue, DerivedComputedBlockSum, NumericValue};
use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue};
use super::super::derived_block::LazyDerivedBlock2Sum;
use super::super::derived_block::LazyBinaryDerivedBlockSum;
const VERSION: Version = Version::ZERO;
@@ -24,7 +24,7 @@ where
pub height: LazyVecFrom2<Height, T, Height, S1T, Height, S2T>,
#[deref]
#[deref_mut]
pub rest: LazyDerivedBlock2Sum<T, S1T, S2T>,
pub rest: LazyBinaryDerivedBlockSum<T, S1T, S2T>,
}
impl<T, S1T, S2T> BinaryBlockSum<T, S1T, S2T>
@@ -38,14 +38,14 @@ where
version: Version,
height_source1: IterableBoxedVec<Height, S1T>,
height_source2: IterableBoxedVec<Height, S2T>,
source1: &DerivedComputedBlockSum<S1T>,
source2: &DerivedComputedBlockSum<S2T>,
source1: &ComputedDerivedBlockSum<S1T>,
source2: &ComputedDerivedBlockSum<S2T>,
) -> Self {
let v = version + VERSION;
Self {
height: LazyVecFrom2::transformed::<F>(name, v, height_source1, height_source2),
rest: LazyDerivedBlock2Sum::from_derived::<F>(name, v, source1, source2),
rest: LazyBinaryDerivedBlockSum::from_derived::<F>(name, v, source1, source2),
}
}
@@ -64,7 +64,7 @@ where
source1.height.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2Sum::from_derived::<F>(name, v, &source1.rest, &source2.rest),
rest: LazyBinaryDerivedBlockSum::from_derived::<F>(name, v, &source1.rest, &source2.rest),
}
}
}
@@ -7,11 +7,11 @@ use schemars::JsonSchema;
use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2};
use crate::internal::{
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockLast,
DerivedComputedBlockSumCum, NumericValue,
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast,
ComputedDerivedBlockSumCum, NumericValue,
};
use super::super::derived_block::LazyDerivedBlock2SumCum;
use super::super::derived_block::LazyBinaryDerivedBlockSumCum;
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -27,7 +27,7 @@ where
pub height_cumulative: LazyVecFrom2<Height, T, Height, S1T, Height, S2T>,
#[deref]
#[deref_mut]
pub rest: LazyDerivedBlock2SumCum<T, S1T, S2T>,
pub rest: LazyBinaryDerivedBlockSumCum<T, S1T, S2T>,
}
const VERSION: Version = Version::ZERO;
@@ -60,7 +60,7 @@ where
source1.height_cumulative.0.boxed_clone(),
source2.height_cumulative.0.boxed_clone(),
),
rest: LazyDerivedBlock2SumCum::from_computed_sum_raw::<F>(
rest: LazyBinaryDerivedBlockSumCum::from_computed_sum_raw::<F>(
name,
v,
&source1.dateindex,
@@ -78,8 +78,8 @@ where
version: Version,
height_source1: IterableBoxedVec<Height, S1T>,
height_source2: IterableBoxedVec<Height, S2T>,
source1: &DerivedComputedBlockSumCum<S1T>,
source2: &DerivedComputedBlockSumCum<S2T>,
source1: &ComputedDerivedBlockSumCum<S1T>,
source2: &ComputedDerivedBlockSumCum<S2T>,
) -> Self
where
S1T: PartialOrd,
@@ -95,7 +95,7 @@ where
source1.height_cumulative.0.boxed_clone(),
source2.height_cumulative.0.boxed_clone(),
),
rest: LazyDerivedBlock2SumCum::from_computed_sum_raw::<F>(
rest: LazyBinaryDerivedBlockSumCum::from_computed_sum_raw::<F>(
name,
v,
&source1.dateindex,
@@ -131,7 +131,7 @@ where
source1.height_cumulative.0.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2SumCum::from_computed_last::<F>(name, v, source1, source2),
rest: LazyBinaryDerivedBlockSumCum::from_computed_last::<F>(name, v, source1, source2),
}
}
@@ -140,7 +140,7 @@ where
version: Version,
height_source1: IterableBoxedVec<Height, S1T>,
height_source2: IterableBoxedVec<Height, S2T>,
source1: &DerivedComputedBlockSumCum<S1T>,
source1: &ComputedDerivedBlockSumCum<S1T>,
source2: &ComputedBlockLast<S2T>,
) -> Self
where
@@ -156,7 +156,7 @@ where
source1.height_cumulative.0.boxed_clone(),
source2.height.boxed_clone(),
),
rest: LazyDerivedBlock2SumCum::from_derived_computed_last::<F>(name, v, source1, source2),
rest: LazyBinaryDerivedBlockSumCum::from_derived_computed_last::<F>(name, v, source1, source2),
}
}
@@ -165,8 +165,8 @@ where
version: Version,
height_source1: IterableBoxedVec<Height, S1T>,
height_source2: IterableBoxedVec<Height, S2T>,
source1: &DerivedComputedBlockSumCum<S1T>,
source2: &DerivedComputedBlockLast<S2T>,
source1: &ComputedDerivedBlockSumCum<S1T>,
source2: &ComputedDerivedBlockLast<S2T>,
) -> Self
where
S1T: NumericValue,
@@ -181,7 +181,7 @@ where
source1.height_cumulative.0.boxed_clone(),
height_source2,
),
rest: LazyDerivedBlock2SumCum::from_derived_last::<F>(name, v, source1, source2),
rest: LazyBinaryDerivedBlockSumCum::from_derived_last::<F>(name, v, source1, source2),
}
}
@@ -191,7 +191,7 @@ where
height_source1: IterableBoxedVec<Height, S1T>,
height_source2: IterableBoxedVec<Height, S2T>,
source1: &ComputedBlockSumCum<S1T>,
source2: &DerivedComputedBlockLast<S2T>,
source2: &ComputedDerivedBlockLast<S2T>,
) -> Self
where
S1T: PartialOrd,
@@ -206,7 +206,7 @@ where
source1.height_cumulative.0.boxed_clone(),
height_source2,
),
rest: LazyDerivedBlock2SumCum::from_computed_derived_last::<F>(name, v, source1, source2),
rest: LazyBinaryDerivedBlockSumCum::from_computed_derived_last::<F>(name, v, source1, source2),
}
}
}
@@ -1,4 +1,4 @@
//! LazyComputedBlockFull - lazy height + DerivedComputedBlockFull.
//! LazyComputedBlockFull - lazy height + ComputedDerivedBlockFull.
use brk_error::Result;
use brk_traversable::Traversable;
@@ -9,7 +9,7 @@ use vecdb::{Database, Exit, IterableCloneableVec, LazyVecFrom1, UnaryTransform};
use crate::{
ComputeIndexes, indexes,
internal::{ComputedVecValue, DerivedComputedBlockFull, NumericValue},
internal::{ComputedVecValue, ComputedDerivedBlockFull, NumericValue},
};
const VERSION: Version = Version::ZERO;
@@ -26,7 +26,7 @@ where
pub height: LazyVecFrom1<Height, T, Height, S>,
#[deref]
#[deref_mut]
pub rest: DerivedComputedBlockFull<T>,
pub rest: ComputedDerivedBlockFull<T>,
}
impl<T, S> LazyComputedBlockFull<T, S>
@@ -46,7 +46,7 @@ where
let height = LazyVecFrom1::transformed::<F>(name, v, source.boxed_clone());
let rest =
DerivedComputedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?;
ComputedDerivedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?;
Ok(Self { height, rest })
}
@@ -64,7 +64,7 @@ where
let height = LazyVecFrom1::init(name, v, source.boxed_clone(), init_fn);
let rest =
DerivedComputedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?;
ComputedDerivedBlockFull::forced_import(db, name, height.boxed_clone(), v, indexes)?;
Ok(Self { height, rest })
}
@@ -9,7 +9,7 @@ use vecdb::{ComputeFrom1, Database, Exit, IterableCloneableVec, LazyVecFrom1, Un
use crate::{
ComputeIndexes, indexes,
internal::{ComputedVecValue, DerivedComputedBlockDistribution, NumericValue},
internal::{ComputedVecValue, ComputedDerivedBlockDistribution, NumericValue},
};
const VERSION: Version = Version::ZERO;
@@ -30,7 +30,7 @@ where
#[deref]
#[deref_mut]
#[traversable(flatten)]
pub rest: DerivedComputedBlockDistribution<T>,
pub rest: ComputedDerivedBlockDistribution<T>,
}
impl<T, S> LazyBlockDistribution<T, S>
@@ -49,7 +49,7 @@ where
let height = LazyVecFrom1::transformed::<F>(name, v, source.boxed_clone());
let rest = DerivedComputedBlockDistribution::forced_import(
let rest = ComputedDerivedBlockDistribution::forced_import(
db,
name,
height.boxed_clone(),
@@ -72,7 +72,7 @@ where
let height = LazyVecFrom1::init(name, v, source.boxed_clone(), init_fn);
let rest = DerivedComputedBlockDistribution::forced_import(
let rest = ComputedDerivedBlockDistribution::forced_import(
db,
name,
height.boxed_clone(),
@@ -7,7 +7,7 @@ use schemars::JsonSchema;
use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform};
use crate::internal::{
ComputedBlockFull, ComputedVecValue, DerivedComputedBlockFull, NumericValue,
ComputedBlockFull, ComputedVecValue, ComputedDerivedBlockFull, NumericValue,
};
use super::super::derived_block::LazyDerivedBlockFull;
@@ -55,7 +55,7 @@ where
name: &str,
version: Version,
height_source: IterableBoxedVec<Height, S1T>,
source: &DerivedComputedBlockFull<S1T>,
source: &ComputedDerivedBlockFull<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -7,7 +7,7 @@ use schemars::JsonSchema;
use vecdb::{IterableBoxedVec, IterableCloneableVec, LazyVecFrom1, UnaryTransform};
use crate::internal::{
ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, DerivedComputedBlockLast,
ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast,
NumericValue,
};
@@ -52,7 +52,7 @@ where
name: &str,
version: Version,
height_source: IterableBoxedVec<Height, S1T>,
source: &DerivedComputedBlockLast<S1T>,
source: &ComputedDerivedBlockLast<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -6,7 +6,7 @@ use derive_more::{Deref, DerefMut};
use schemars::JsonSchema;
use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform};
use crate::internal::{ComputedBlockSum, ComputedVecValue, DerivedComputedBlockSum, NumericValue};
use crate::internal::{ComputedBlockSum, ComputedVecValue, ComputedDerivedBlockSum, NumericValue};
use super::super::derived_block::LazyDerivedBlockSum;
#[derive(Clone, Deref, DerefMut, Traversable)]
@@ -53,7 +53,7 @@ where
name: &str,
version: Version,
height_source: IterableBoxedVec<Height, S1T>,
source: &DerivedComputedBlockSum<S1T>,
source: &ComputedDerivedBlockSum<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -7,7 +7,7 @@ use schemars::JsonSchema;
use vecdb::{IterableBoxedVec, LazyVecFrom1, UnaryTransform};
use crate::internal::{
ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockSumCum, NumericValue,
ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockSumCum, NumericValue,
};
use super::super::derived_block::LazyDerivedBlockSumCum;
@@ -55,7 +55,7 @@ where
name: &str,
version: Version,
height_source: IterableBoxedVec<Height, S1T>,
source: &DerivedComputedBlockSumCum<S1T>,
source: &ComputedDerivedBlockSumCum<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -8,11 +8,11 @@ use schemars::JsonSchema;
use vecdb::{BinaryTransform, IterableBoxedVec, IterableCloneableVec, LazyVecFrom2};
use crate::internal::{
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, DerivedDateLast,
DerivedDateSumCum, NumericValue,
ComputedBlockLast, ComputedBlockSum, ComputedDateLast, ComputedVecValue, LazyPeriodsLast,
LazyPeriodsSumCum, NumericValue,
};
use super::super::transform::LazyTransform2Last;
use super::super::transform::LazyBinaryTransformLast;
const VERSION: Version = Version::ZERO;
@@ -25,12 +25,12 @@ where
S2T: ComputedVecValue,
{
pub dateindex: LazyVecFrom2<DateIndex, T, DateIndex, S1T, DateIndex, S2T>,
pub weekindex: LazyTransform2Last<WeekIndex, T, S1T, S2T>,
pub monthindex: LazyTransform2Last<MonthIndex, T, S1T, S2T>,
pub quarterindex: LazyTransform2Last<QuarterIndex, T, S1T, S2T>,
pub semesterindex: LazyTransform2Last<SemesterIndex, T, S1T, S2T>,
pub yearindex: LazyTransform2Last<YearIndex, T, S1T, S2T>,
pub decadeindex: LazyTransform2Last<DecadeIndex, T, S1T, S2T>,
pub weekindex: LazyBinaryTransformLast<WeekIndex, T, S1T, S2T>,
pub monthindex: LazyBinaryTransformLast<MonthIndex, T, S1T, S2T>,
pub quarterindex: LazyBinaryTransformLast<QuarterIndex, T, S1T, S2T>,
pub semesterindex: LazyBinaryTransformLast<SemesterIndex, T, S1T, S2T>,
pub yearindex: LazyBinaryTransformLast<YearIndex, T, S1T, S2T>,
pub decadeindex: LazyBinaryTransformLast<DecadeIndex, T, S1T, S2T>,
}
impl<T, S1T, S2T> LazyBinaryDateLast<T, S1T, S2T>
@@ -49,7 +49,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_lazy_last::<F, _, _, _, _>(
LazyBinaryTransformLast::from_lazy_last::<F, _, _, _, _>(
name,
v,
&source1.$p,
@@ -78,14 +78,14 @@ where
name: &str,
version: Version,
dateindex_source1: IterableBoxedVec<DateIndex, S1T>,
source1: &DerivedDateLast<S1T>,
source1: &LazyPeriodsLast<S1T>,
source2: &ComputedDateLast<S2T>,
) -> Self {
let v = version + VERSION;
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_lazy_last::<F, _, _, _, _>(
LazyBinaryTransformLast::from_lazy_last::<F, _, _, _, _>(
name,
v,
&source1.$p,
@@ -114,7 +114,7 @@ where
name: &str,
version: Version,
dateindex_source1: IterableBoxedVec<DateIndex, S1T>,
source1: &DerivedDateLast<S1T>,
source1: &LazyPeriodsLast<S1T>,
source2: &ComputedBlockLast<S2T>,
) -> Self
where
@@ -124,7 +124,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_lazy_last::<F, _, _, _, _>(
LazyBinaryTransformLast::from_lazy_last::<F, _, _, _, _>(
name,
v,
&source1.$p,
@@ -153,15 +153,15 @@ where
name: &str,
version: Version,
dateindex_source1: IterableBoxedVec<DateIndex, S1T>,
source1: &DerivedDateLast<S1T>,
source1: &LazyPeriodsLast<S1T>,
dateindex_source2: IterableBoxedVec<DateIndex, S2T>,
source2: &DerivedDateLast<S2T>,
source2: &LazyPeriodsLast<S2T>,
) -> Self {
let v = version + VERSION;
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_lazy_last::<F, _, _, _, _>(
LazyBinaryTransformLast::from_lazy_last::<F, _, _, _, _>(
name,
v,
&source1.$p,
@@ -199,7 +199,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_lazy_last::<F, _, _, _, _>(
LazyBinaryTransformLast::from_lazy_last::<F, _, _, _, _>(
name,
v,
&source1.$p,
@@ -237,7 +237,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_lazy_last::<F, _, _, _, _>(
LazyBinaryTransformLast::from_lazy_last::<F, _, _, _, _>(
name,
v,
&source1.$p,
@@ -276,7 +276,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_lazy_last::<F, _, _, _, _>(
LazyBinaryTransformLast::from_lazy_last::<F, _, _, _, _>(
name,
v,
&source1.$p,
@@ -314,7 +314,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.$p.boxed_clone(),
@@ -353,7 +353,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.$p.boxed_clone(),
@@ -382,9 +382,9 @@ where
name: &str,
version: Version,
dateindex_source1: IterableBoxedVec<DateIndex, S1T>,
dates1: &DerivedDateSumCum<S1T>,
dates1: &LazyPeriodsSumCum<S1T>,
dateindex_source2: IterableBoxedVec<DateIndex, S2T>,
dates2: &DerivedDateSumCum<S2T>,
dates2: &LazyPeriodsSumCum<S2T>,
) -> Self
where
S1T: PartialOrd,
@@ -394,7 +394,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
dates1.$p.cumulative.boxed_clone(),
@@ -419,12 +419,12 @@ where
}
}
/// Create from a DerivedDateLast source and a BinaryDateLast source.
/// Create from a LazyPeriodsLast source and a BinaryDateLast source.
pub fn from_derived_last_and_binary_last<F, S2aT, S2bT>(
name: &str,
version: Version,
dateindex_source1: IterableBoxedVec<DateIndex, S1T>,
source1: &DerivedDateLast<S1T>,
source1: &LazyPeriodsLast<S1T>,
source2: &LazyBinaryDateLast<S2T, S2aT, S2bT>,
) -> Self
where
@@ -436,7 +436,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.$p.boxed_clone(),
@@ -477,7 +477,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.$p.boxed_clone(),
@@ -519,7 +519,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.$p.boxed_clone(),
@@ -560,7 +560,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.$p.boxed_clone(),
@@ -603,7 +603,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2Last::from_vecs::<F>(
LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.$p.boxed_clone(),
@@ -7,28 +7,28 @@ use brk_types::{
use schemars::JsonSchema;
use vecdb::{BinaryTransform, IterableCloneableVec};
use crate::internal::{ComputedVecValue, DerivedComputedBlockSum, LazyTransform2Sum, NumericValue};
use crate::internal::{ComputedVecValue, ComputedDerivedBlockSum, LazyBinaryTransformSum, NumericValue};
const VERSION: Version = Version::ZERO;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct LazyDate2Sum<T, S1T, S2T>
pub struct LazyBinaryDateSum<T, S1T, S2T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
S1T: ComputedVecValue,
S2T: ComputedVecValue,
{
pub dateindex: LazyTransform2Sum<DateIndex, T, S1T, S2T>,
pub weekindex: LazyTransform2Sum<WeekIndex, T, S1T, S2T>,
pub monthindex: LazyTransform2Sum<MonthIndex, T, S1T, S2T>,
pub quarterindex: LazyTransform2Sum<QuarterIndex, T, S1T, S2T>,
pub semesterindex: LazyTransform2Sum<SemesterIndex, T, S1T, S2T>,
pub yearindex: LazyTransform2Sum<YearIndex, T, S1T, S2T>,
pub decadeindex: LazyTransform2Sum<DecadeIndex, T, S1T, S2T>,
pub dateindex: LazyBinaryTransformSum<DateIndex, T, S1T, S2T>,
pub weekindex: LazyBinaryTransformSum<WeekIndex, T, S1T, S2T>,
pub monthindex: LazyBinaryTransformSum<MonthIndex, T, S1T, S2T>,
pub quarterindex: LazyBinaryTransformSum<QuarterIndex, T, S1T, S2T>,
pub semesterindex: LazyBinaryTransformSum<SemesterIndex, T, S1T, S2T>,
pub yearindex: LazyBinaryTransformSum<YearIndex, T, S1T, S2T>,
pub decadeindex: LazyBinaryTransformSum<DecadeIndex, T, S1T, S2T>,
}
impl<T, S1T, S2T> LazyDate2Sum<T, S1T, S2T>
impl<T, S1T, S2T> LazyBinaryDateSum<T, S1T, S2T>
where
T: ComputedVecValue + JsonSchema + 'static,
S1T: NumericValue + JsonSchema,
@@ -37,19 +37,19 @@ where
pub fn from_derived<F: BinaryTransform<S1T, S2T, T>>(
name: &str,
version: Version,
source1: &DerivedComputedBlockSum<S1T>,
source2: &DerivedComputedBlockSum<S2T>,
source1: &ComputedDerivedBlockSum<S1T>,
source2: &ComputedDerivedBlockSum<S2T>,
) -> Self {
let v = version + VERSION;
macro_rules! period {
($p:ident) => {
LazyTransform2Sum::from_boxed::<F>(name, v, source1.$p.boxed_clone(), source2.$p.boxed_clone())
LazyBinaryTransformSum::from_boxed::<F>(name, v, source1.$p.boxed_clone(), source2.$p.boxed_clone())
};
}
Self {
dateindex: LazyTransform2Sum::from_sum::<F>(name, v, &source1.dateindex, &source2.dateindex),
dateindex: LazyBinaryTransformSum::from_sum::<F>(name, v, &source1.dateindex, &source2.dateindex),
weekindex: period!(weekindex),
monthindex: period!(monthindex),
quarterindex: period!(quarterindex),
@@ -8,32 +8,32 @@ use schemars::JsonSchema;
use vecdb::{BinaryTransform, IterableCloneableVec};
use crate::internal::{
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockLast,
DerivedComputedBlockSumCum, DerivedDateFull, DerivedDateSumCum, NumericValue, SumCum,
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast,
ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, NumericValue, SumCum,
};
use super::super::transform::LazyTransform2SumCum;
use super::super::transform::LazyBinaryTransformSumCum;
const VERSION: Version = Version::ZERO;
#[derive(Clone, Traversable)]
#[traversable(merge)]
pub struct LazyDate2SumCum<T, S1T = T, S2T = T>
pub struct LazyBinaryDateSumCum<T, S1T = T, S2T = T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
S1T: ComputedVecValue,
S2T: ComputedVecValue,
{
pub dateindex: LazyTransform2SumCum<DateIndex, T, S1T, S2T>,
pub weekindex: LazyTransform2SumCum<WeekIndex, T, S1T, S2T>,
pub monthindex: LazyTransform2SumCum<MonthIndex, T, S1T, S2T>,
pub quarterindex: LazyTransform2SumCum<QuarterIndex, T, S1T, S2T>,
pub semesterindex: LazyTransform2SumCum<SemesterIndex, T, S1T, S2T>,
pub yearindex: LazyTransform2SumCum<YearIndex, T, S1T, S2T>,
pub decadeindex: LazyTransform2SumCum<DecadeIndex, T, S1T, S2T>,
pub dateindex: LazyBinaryTransformSumCum<DateIndex, T, S1T, S2T>,
pub weekindex: LazyBinaryTransformSumCum<WeekIndex, T, S1T, S2T>,
pub monthindex: LazyBinaryTransformSumCum<MonthIndex, T, S1T, S2T>,
pub quarterindex: LazyBinaryTransformSumCum<QuarterIndex, T, S1T, S2T>,
pub semesterindex: LazyBinaryTransformSumCum<SemesterIndex, T, S1T, S2T>,
pub yearindex: LazyBinaryTransformSumCum<YearIndex, T, S1T, S2T>,
pub decadeindex: LazyBinaryTransformSumCum<DecadeIndex, T, S1T, S2T>,
}
impl<T, S1T, S2T> LazyDate2SumCum<T, S1T, S2T>
impl<T, S1T, S2T> LazyBinaryDateSumCum<T, S1T, S2T>
where
T: ComputedVecValue + JsonSchema + 'static,
S1T: ComputedVecValue + JsonSchema,
@@ -44,15 +44,15 @@ where
name: &str,
version: Version,
dateindex1: &SumCum<DateIndex, S1T>,
periods1: &DerivedDateSumCum<S1T>,
periods1: &LazyPeriodsSumCum<S1T>,
dateindex2: &SumCum<DateIndex, S2T>,
periods2: &DerivedDateSumCum<S2T>,
periods2: &LazyPeriodsSumCum<S2T>,
) -> Self {
let v = version + VERSION;
macro_rules! period {
($p:ident) => {
LazyTransform2SumCum::from_sources::<F>(
LazyBinaryTransformSumCum::from_sources::<F>(
name, v,
periods1.$p.sum.boxed_clone(), periods2.$p.sum.boxed_clone(),
periods1.$p.cumulative.boxed_clone(), periods2.$p.cumulative.boxed_clone(),
@@ -61,7 +61,7 @@ where
}
Self {
dateindex: LazyTransform2SumCum::from_sum_cum::<F>(name, v, dateindex1, dateindex2),
dateindex: LazyBinaryTransformSumCum::from_sum_cum::<F>(name, v, dateindex1, dateindex2),
weekindex: period!(weekindex),
monthindex: period!(monthindex),
quarterindex: period!(quarterindex),
@@ -75,22 +75,22 @@ where
name: &str,
version: Version,
dateindex1: &SumCum<DateIndex, S1T>,
dates1: &DerivedDateFull<S1T>,
dates1: &LazyPeriodsFull<S1T>,
dateindex2: &SumCum<DateIndex, S2T>,
dates2: &DerivedDateFull<S2T>,
dates2: &LazyPeriodsFull<S2T>,
) -> Self {
let v = version + VERSION;
macro_rules! period {
($p:ident) => {
LazyTransform2SumCum::from_lazy_stats_aggregate::<F, _, _, _, _>(
LazyBinaryTransformSumCum::from_lazy_stats_aggregate::<F, _, _, _, _>(
name, v, &dates1.$p, &dates2.$p,
)
};
}
Self {
dateindex: LazyTransform2SumCum::from_sum_cum::<F>(name, v, dateindex1, dateindex2),
dateindex: LazyBinaryTransformSumCum::from_sum_cum::<F>(name, v, dateindex1, dateindex2),
weekindex: period!(weekindex),
monthindex: period!(monthindex),
quarterindex: period!(quarterindex),
@@ -107,15 +107,15 @@ where
name: &str,
version: Version,
dateindex1: &SumCum<DateIndex, S1T>,
periods1: &DerivedDateSumCum<S1T>,
periods1: &LazyPeriodsSumCum<S1T>,
dateindex2: &SumCum<DateIndex, S2T>,
periods2: &DerivedDateSumCum<S2T>,
periods2: &LazyPeriodsSumCum<S2T>,
) -> Self {
let v = version + VERSION;
macro_rules! period {
($p:ident) => {
LazyTransform2SumCum::from_sources_sum_raw::<F>(
LazyBinaryTransformSumCum::from_sources_sum_raw::<F>(
name, v,
periods1.$p.sum.boxed_clone(), periods2.$p.sum.boxed_clone(),
periods1.$p.cumulative.boxed_clone(), periods2.$p.cumulative.boxed_clone(),
@@ -124,7 +124,7 @@ where
}
Self {
dateindex: LazyTransform2SumCum::from_sum_cum_sum_raw::<F>(name, v, dateindex1, dateindex2),
dateindex: LazyBinaryTransformSumCum::from_sum_cum_sum_raw::<F>(name, v, dateindex1, dateindex2),
weekindex: period!(weekindex),
monthindex: period!(monthindex),
quarterindex: period!(quarterindex),
@@ -150,7 +150,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name, v,
source1.rest.$p.sum.boxed_clone(),
source1.rest.$p.cumulative.boxed_clone(),
@@ -160,7 +160,7 @@ where
}
Self {
dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::<F>(
dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::<F>(
name, v, &source1.dateindex, &source2.dateindex,
),
weekindex: period!(weekindex),
@@ -175,7 +175,7 @@ where
pub fn from_derived_computed_last<F: BinaryTransform<S1T, S2T, T>>(
name: &str,
version: Version,
source1: &DerivedComputedBlockSumCum<S1T>,
source1: &ComputedDerivedBlockSumCum<S1T>,
source2: &ComputedBlockLast<S2T>,
) -> Self
where
@@ -186,7 +186,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name, v,
source1.$p.sum.boxed_clone(),
source1.$p.cumulative.boxed_clone(),
@@ -196,7 +196,7 @@ where
}
Self {
dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::<F>(
dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::<F>(
name, v, &source1.dateindex, &source2.dateindex,
),
weekindex: period!(weekindex),
@@ -212,7 +212,7 @@ where
name: &str,
version: Version,
source1: &ComputedBlockSumCum<S1T>,
source2: &DerivedComputedBlockLast<S2T>,
source2: &ComputedDerivedBlockLast<S2T>,
) -> Self
where
S1T: PartialOrd,
@@ -222,7 +222,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name, v,
source1.rest.$p.sum.boxed_clone(),
source1.rest.$p.cumulative.boxed_clone(),
@@ -232,7 +232,7 @@ where
}
Self {
dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::<F>(
dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::<F>(
name, v, &source1.dateindex, &source2.dateindex,
),
weekindex: period!(weekindex),
@@ -247,8 +247,8 @@ where
pub fn from_derived_last<F: BinaryTransform<S1T, S2T, T>>(
name: &str,
version: Version,
source1: &DerivedComputedBlockSumCum<S1T>,
source2: &DerivedComputedBlockLast<S2T>,
source1: &ComputedDerivedBlockSumCum<S1T>,
source2: &ComputedDerivedBlockLast<S2T>,
) -> Self
where
S1T: NumericValue,
@@ -258,7 +258,7 @@ where
macro_rules! period {
($p:ident) => {
LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name, v,
source1.$p.sum.boxed_clone(),
source1.$p.cumulative.boxed_clone(),
@@ -268,7 +268,7 @@ where
}
Self {
dateindex: LazyTransform2SumCum::from_sum_cum_last_sum_raw::<F>(
dateindex: LazyBinaryTransformSumCum::from_sum_cum_last_sum_raw::<F>(
name, v, &source1.dateindex, &source2.dateindex,
),
weekindex: period!(weekindex),
@@ -5,7 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex,
use schemars::JsonSchema;
use vecdb::{IterableCloneableVec, UnaryTransform};
use crate::internal::{ComputedVecValue, DerivedDateFull, Full};
use crate::internal::{ComputedVecValue, LazyPeriodsFull, Full};
use super::super::transform::{LazyTransformFull, LazyTransformStats};
@@ -36,7 +36,7 @@ where
name: &str,
version: Version,
dateindex: &Full<DateIndex, S1T>,
source: &DerivedDateFull<S1T>,
source: &LazyPeriodsFull<S1T>,
) -> Self {
let v = version + VERSION;
@@ -7,7 +7,7 @@ use brk_types::{
use schemars::JsonSchema;
use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform};
use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, DerivedDateLast, NumericValue};
use crate::internal::{ComputedBlockLast, ComputedDateLast, ComputedVecValue, LazyPeriodsLast, NumericValue};
use super::super::transform::LazyTransformLast;
@@ -55,7 +55,7 @@ where
name: &str,
version: Version,
dateindex_source: IterableBoxedVec<DateIndex, S1T>,
source: &DerivedDateLast<S1T>,
source: &LazyPeriodsLast<S1T>,
) -> Self {
let v = version + VERSION;
@@ -5,7 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex,
use schemars::JsonSchema;
use vecdb::{IterableBoxedVec, IterableCloneableVec, UnaryTransform};
use crate::internal::{ComputedVecValue, DerivedDateSum};
use crate::internal::{ComputedVecValue, LazyPeriodsSum};
use super::super::transform::LazyTransformSum;
@@ -36,7 +36,7 @@ where
name: &str,
version: Version,
dateindex_source: IterableBoxedVec<DateIndex, S1T>,
source: &DerivedDateSum<S1T>,
source: &LazyPeriodsSum<S1T>,
) -> Self {
let v = version + VERSION;
@@ -5,7 +5,7 @@ use brk_types::{DateIndex, DecadeIndex, MonthIndex, QuarterIndex, SemesterIndex,
use schemars::JsonSchema;
use vecdb::{IterableCloneableVec, UnaryTransform};
use crate::internal::{ComputedVecValue, DerivedDateSumCum, SumCum};
use crate::internal::{ComputedVecValue, LazyPeriodsSumCum, SumCum};
use super::super::transform::LazyTransformSumCum;
@@ -36,7 +36,7 @@ where
name: &str,
version: Version,
dateindex: &SumCum<DateIndex, S1T>,
source: &DerivedDateSumCum<S1T>,
source: &LazyPeriodsSumCum<S1T>,
) -> Self {
let v = version + VERSION;
@@ -8,12 +8,12 @@ use vecdb::{BinaryTransform, IterableCloneableVec};
use crate::internal::{
ComputedBlockLast, ComputedBlockSumCum, ComputedHeightDateLast, ComputedVecValue,
LazyBinaryDateLast, LazyTransform2Last, NumericValue,
LazyBinaryDateLast, LazyBinaryTransformLast, NumericValue,
};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct LazyDerivedBlock2Last<T, S1T = T, S2T = T>
pub struct LazyBinaryDerivedBlockLast<T, S1T = T, S2T = T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
S1T: ComputedVecValue,
@@ -22,12 +22,12 @@ where
#[deref]
#[deref_mut]
pub dates: LazyBinaryDateLast<T, S1T, S2T>,
pub difficultyepoch: LazyTransform2Last<DifficultyEpoch, T, S1T, S2T>,
pub difficultyepoch: LazyBinaryTransformLast<DifficultyEpoch, T, S1T, S2T>,
}
const VERSION: Version = Version::ZERO;
impl<T, S1T, S2T> LazyDerivedBlock2Last<T, S1T, S2T>
impl<T, S1T, S2T> LazyBinaryDerivedBlockLast<T, S1T, S2T>
where
T: ComputedVecValue + JsonSchema + 'static,
S1T: ComputedVecValue + JsonSchema,
@@ -54,7 +54,7 @@ where
source2.dateindex.cumulative.boxed_clone(),
&source2.dates,
),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.difficultyepoch.cumulative.boxed_clone(),
@@ -77,7 +77,7 @@ where
Self {
dates: LazyBinaryDateLast::from_both_block_last::<F>(name, v, source1, source2),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.difficultyepoch.boxed_clone(),
@@ -105,7 +105,7 @@ where
&source1.rest,
&source2.rest,
),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.difficultyepoch.0.boxed_clone(),
@@ -133,7 +133,7 @@ where
&source1.rest,
source2,
),
difficultyepoch: LazyTransform2Last::from_vecs::<F>(
difficultyepoch: LazyBinaryTransformLast::from_vecs::<F>(
name,
v,
source1.difficultyepoch.0.boxed_clone(),
@@ -6,13 +6,13 @@ use derive_more::{Deref, DerefMut};
use schemars::JsonSchema;
use vecdb::{BinaryTransform, IterableCloneableVec};
use crate::internal::{ComputedVecValue, DerivedComputedBlockSum, LazyDate2Sum, LazyTransform2Sum, NumericValue};
use crate::internal::{ComputedVecValue, ComputedDerivedBlockSum, LazyBinaryDateSum, LazyBinaryTransformSum, NumericValue};
const VERSION: Version = Version::ZERO;
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct LazyDerivedBlock2Sum<T, S1T, S2T>
pub struct LazyBinaryDerivedBlockSum<T, S1T, S2T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
S1T: ComputedVecValue,
@@ -20,11 +20,11 @@ where
{
#[deref]
#[deref_mut]
pub dates: LazyDate2Sum<T, S1T, S2T>,
pub difficultyepoch: LazyTransform2Sum<DifficultyEpoch, T, S1T, S2T>,
pub dates: LazyBinaryDateSum<T, S1T, S2T>,
pub difficultyepoch: LazyBinaryTransformSum<DifficultyEpoch, T, S1T, S2T>,
}
impl<T, S1T, S2T> LazyDerivedBlock2Sum<T, S1T, S2T>
impl<T, S1T, S2T> LazyBinaryDerivedBlockSum<T, S1T, S2T>
where
T: ComputedVecValue + JsonSchema + 'static,
S1T: NumericValue + JsonSchema,
@@ -33,14 +33,14 @@ where
pub fn from_derived<F: BinaryTransform<S1T, S2T, T>>(
name: &str,
version: Version,
source1: &DerivedComputedBlockSum<S1T>,
source2: &DerivedComputedBlockSum<S2T>,
source1: &ComputedDerivedBlockSum<S1T>,
source2: &ComputedDerivedBlockSum<S2T>,
) -> Self {
let v = version + VERSION;
Self {
dates: LazyDate2Sum::from_derived::<F>(name, v, source1, source2),
difficultyepoch: LazyTransform2Sum::from_boxed::<F>(
dates: LazyBinaryDateSum::from_derived::<F>(name, v, source1, source2),
difficultyepoch: LazyBinaryTransformSum::from_boxed::<F>(
name,
v,
source1.difficultyepoch.boxed_clone(),
@@ -7,18 +7,18 @@ use schemars::JsonSchema;
use vecdb::{BinaryTransform, IterableCloneableVec};
use crate::internal::{
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, DerivedComputedBlockLast,
DerivedComputedBlockSumCum, DerivedDateFull, DerivedDateSumCum, LazyDate2SumCum, LazyFull,
ComputedBlockLast, ComputedBlockSumCum, ComputedVecValue, ComputedDerivedBlockLast,
ComputedDerivedBlockSumCum, LazyPeriodsFull, LazyPeriodsSumCum, LazyBinaryDateSumCum, LazyFull,
LazySumCum, NumericValue, SumCum,
};
use super::super::transform::LazyTransform2SumCum;
use super::super::transform::LazyBinaryTransformSumCum;
const VERSION: Version = Version::ZERO;
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
pub struct LazyDerivedBlock2SumCum<T, S1T = T, S2T = T>
pub struct LazyBinaryDerivedBlockSumCum<T, S1T = T, S2T = T>
where
T: ComputedVecValue + PartialOrd + JsonSchema,
S1T: ComputedVecValue,
@@ -26,11 +26,11 @@ where
{
#[deref]
#[deref_mut]
pub dates: LazyDate2SumCum<T, S1T, S2T>,
pub difficultyepoch: LazyTransform2SumCum<DifficultyEpoch, T, S1T, S2T>,
pub dates: LazyBinaryDateSumCum<T, S1T, S2T>,
pub difficultyepoch: LazyBinaryTransformSumCum<DifficultyEpoch, T, S1T, S2T>,
}
impl<T, S1T, S2T> LazyDerivedBlock2SumCum<T, S1T, S2T>
impl<T, S1T, S2T> LazyBinaryDerivedBlockSumCum<T, S1T, S2T>
where
T: ComputedVecValue + JsonSchema + 'static,
S1T: ComputedVecValue + JsonSchema,
@@ -41,19 +41,19 @@ where
name: &str,
version: Version,
dateindex1: &SumCum<brk_types::DateIndex, S1T>,
periods1: &DerivedDateSumCum<S1T>,
periods1: &LazyPeriodsSumCum<S1T>,
difficultyepoch1: &LazySumCum<DifficultyEpoch, S1T, Height, DifficultyEpoch>,
dateindex2: &SumCum<brk_types::DateIndex, S2T>,
periods2: &DerivedDateSumCum<S2T>,
periods2: &LazyPeriodsSumCum<S2T>,
difficultyepoch2: &LazySumCum<DifficultyEpoch, S2T, Height, DifficultyEpoch>,
) -> Self {
let v = version + VERSION;
Self {
dates: LazyDate2SumCum::from_computed::<F>(
dates: LazyBinaryDateSumCum::from_computed::<F>(
name, v, dateindex1, periods1, dateindex2, periods2,
),
difficultyepoch: LazyTransform2SumCum::from_sources::<F>(
difficultyepoch: LazyBinaryTransformSumCum::from_sources::<F>(
name,
v,
difficultyepoch1.sum.boxed_clone(),
@@ -69,10 +69,10 @@ where
name: &str,
version: Version,
dateindex1: &SumCum<brk_types::DateIndex, S1T>,
dates1: &DerivedDateFull<S1T>,
dates1: &LazyPeriodsFull<S1T>,
difficultyepoch1: &LazyFull<DifficultyEpoch, S1T, S1I, S1L>,
dateindex2: &SumCum<brk_types::DateIndex, S2T>,
dates2: &DerivedDateFull<S2T>,
dates2: &LazyPeriodsFull<S2T>,
difficultyepoch2: &LazyFull<DifficultyEpoch, S2T, S2I, S2L>,
) -> Self
where
@@ -85,10 +85,10 @@ where
let v = version + VERSION;
Self {
dates: LazyDate2SumCum::from_derived_full::<F>(
dates: LazyBinaryDateSumCum::from_derived_full::<F>(
name, v, dateindex1, dates1, dateindex2, dates2,
),
difficultyepoch: LazyTransform2SumCum::from_lazy_stats_aggregate::<F, _, _, _, _>(
difficultyepoch: LazyBinaryTransformSumCum::from_lazy_stats_aggregate::<F, _, _, _, _>(
name,
v,
difficultyepoch1,
@@ -103,19 +103,19 @@ where
name: &str,
version: Version,
dateindex1: &SumCum<brk_types::DateIndex, S1T>,
periods1: &DerivedDateSumCum<S1T>,
periods1: &LazyPeriodsSumCum<S1T>,
difficultyepoch1: &LazySumCum<DifficultyEpoch, S1T, Height, DifficultyEpoch>,
dateindex2: &SumCum<brk_types::DateIndex, S2T>,
periods2: &DerivedDateSumCum<S2T>,
periods2: &LazyPeriodsSumCum<S2T>,
difficultyepoch2: &LazySumCum<DifficultyEpoch, S2T, Height, DifficultyEpoch>,
) -> Self {
let v = version + VERSION;
Self {
dates: LazyDate2SumCum::from_computed_sum_raw::<F>(
dates: LazyBinaryDateSumCum::from_computed_sum_raw::<F>(
name, v, dateindex1, periods1, dateindex2, periods2,
),
difficultyepoch: LazyTransform2SumCum::from_sources_sum_raw::<F>(
difficultyepoch: LazyBinaryTransformSumCum::from_sources_sum_raw::<F>(
name,
v,
difficultyepoch1.sum.boxed_clone(),
@@ -141,8 +141,8 @@ where
let v = version + VERSION;
Self {
dates: LazyDate2SumCum::from_computed_last::<F>(name, v, source1, source2),
difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
dates: LazyBinaryDateSumCum::from_computed_last::<F>(name, v, source1, source2),
difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name,
v,
source1.difficultyepoch.sum.boxed_clone(),
@@ -155,7 +155,7 @@ where
pub fn from_derived_computed_last<F: BinaryTransform<S1T, S2T, T>>(
name: &str,
version: Version,
source1: &DerivedComputedBlockSumCum<S1T>,
source1: &ComputedDerivedBlockSumCum<S1T>,
source2: &ComputedBlockLast<S2T>,
) -> Self
where
@@ -165,8 +165,8 @@ where
let v = version + VERSION;
Self {
dates: LazyDate2SumCum::from_derived_computed_last::<F>(name, v, source1, source2),
difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
dates: LazyBinaryDateSumCum::from_derived_computed_last::<F>(name, v, source1, source2),
difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name,
v,
source1.difficultyepoch.sum.boxed_clone(),
@@ -180,7 +180,7 @@ where
name: &str,
version: Version,
source1: &ComputedBlockSumCum<S1T>,
source2: &DerivedComputedBlockLast<S2T>,
source2: &ComputedDerivedBlockLast<S2T>,
) -> Self
where
S1T: PartialOrd,
@@ -189,8 +189,8 @@ where
let v = version + VERSION;
Self {
dates: LazyDate2SumCum::from_computed_derived_last::<F>(name, v, source1, source2),
difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
dates: LazyBinaryDateSumCum::from_computed_derived_last::<F>(name, v, source1, source2),
difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name,
v,
source1.difficultyepoch.sum.boxed_clone(),
@@ -203,8 +203,8 @@ where
pub fn from_derived_last<F: BinaryTransform<S1T, S2T, T>>(
name: &str,
version: Version,
source1: &DerivedComputedBlockSumCum<S1T>,
source2: &DerivedComputedBlockLast<S2T>,
source1: &ComputedDerivedBlockSumCum<S1T>,
source2: &ComputedDerivedBlockLast<S2T>,
) -> Self
where
S1T: NumericValue,
@@ -213,8 +213,8 @@ where
let v = version + VERSION;
Self {
dates: LazyDate2SumCum::from_derived_last::<F>(name, v, source1, source2),
difficultyepoch: LazyTransform2SumCum::from_sources_last_sum_raw::<F>(
dates: LazyBinaryDateSumCum::from_derived_last::<F>(name, v, source1, source2),
difficultyepoch: LazyBinaryTransformSumCum::from_sources_last_sum_raw::<F>(
name,
v,
source1.difficultyepoch.sum.boxed_clone(),
@@ -7,7 +7,7 @@ use schemars::JsonSchema;
use vecdb::{IterableCloneableVec, UnaryTransform};
use crate::internal::{
ComputedVecValue, DerivedComputedBlockFull, DerivedDateFull, Full, LazyDateFull, NumericValue,
ComputedVecValue, ComputedDerivedBlockFull, LazyPeriodsFull, Full, LazyDateFull, NumericValue,
};
use super::super::transform::LazyTransformStats;
@@ -36,7 +36,7 @@ where
name: &str,
version: Version,
dateindex: &Full<DateIndex, S1T>,
periods: &DerivedDateFull<S1T>,
periods: &LazyPeriodsFull<S1T>,
difficultyepoch: &crate::internal::LazyFull<
DifficultyEpoch,
S1T,
@@ -63,7 +63,7 @@ where
pub fn from_derived_computed<F: UnaryTransform<S1T, T>>(
name: &str,
version: Version,
source: &DerivedComputedBlockFull<S1T>,
source: &ComputedDerivedBlockFull<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -7,7 +7,7 @@ use schemars::JsonSchema;
use vecdb::{IterableCloneableVec, UnaryTransform};
use crate::internal::{
ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, DerivedComputedBlockLast,
ComputedBlockLast, ComputedHeightDateLast, ComputedVecValue, ComputedDerivedBlockLast,
LazyDateLast, NumericValue,
};
@@ -61,7 +61,7 @@ where
pub fn from_derived_computed<F: UnaryTransform<S1T, T>>(
name: &str,
version: Version,
source: &DerivedComputedBlockLast<S1T>,
source: &ComputedDerivedBlockLast<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -7,7 +7,7 @@ use schemars::JsonSchema;
use vecdb::{IterableCloneableVec, UnaryTransform};
use crate::internal::{
ComputedVecValue, DerivedComputedBlockSum, DerivedDateSum, LazyDateSum, LazySum, NumericValue, SumVec,
ComputedVecValue, ComputedDerivedBlockSum, LazyPeriodsSum, LazyDateSum, LazySum, NumericValue, SumVec,
};
use super::super::transform::LazyTransformSum;
@@ -36,7 +36,7 @@ where
name: &str,
version: Version,
dateindex: &SumVec<DateIndex, S1T>,
periods: &DerivedDateSum<S1T>,
periods: &LazyPeriodsSum<S1T>,
difficultyepoch: &LazySum<DifficultyEpoch, S1T, Height, DifficultyEpoch>,
) -> Self {
let v = version + VERSION;
@@ -54,7 +54,7 @@ where
pub fn from_derived_computed<F: UnaryTransform<S1T, T>>(
name: &str,
version: Version,
source: &DerivedComputedBlockSum<S1T>,
source: &ComputedDerivedBlockSum<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -7,7 +7,7 @@ use schemars::JsonSchema;
use vecdb::{IterableCloneableVec, UnaryTransform};
use crate::internal::{
ComputedVecValue, DerivedComputedBlockSumCum, DerivedDateSumCum, LazyDateSumCum, LazySumCum,
ComputedVecValue, ComputedDerivedBlockSumCum, LazyPeriodsSumCum, LazyDateSumCum, LazySumCum,
NumericValue, SumCum,
};
@@ -37,7 +37,7 @@ where
name: &str,
version: Version,
dateindex: &SumCum<DateIndex, S1T>,
periods: &DerivedDateSumCum<S1T>,
periods: &LazyPeriodsSumCum<S1T>,
difficultyepoch: &LazySumCum<DifficultyEpoch, S1T, Height, DifficultyEpoch>,
) -> Self {
let v = version + VERSION;
@@ -56,7 +56,7 @@ where
pub fn from_derived_computed<F: UnaryTransform<S1T, T>>(
name: &str,
version: Version,
source: &DerivedComputedBlockSumCum<S1T>,
source: &ComputedDerivedBlockSumCum<S1T>,
) -> Self
where
S1T: NumericValue,
@@ -10,14 +10,14 @@ use crate::internal::{ComputedVecValue, LazyLast};
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(wrap = "last")]
pub struct LazyTransform2Last<I, T, S1T, S2T>(pub LazyVecFrom2<I, T, I, S1T, I, S2T>)
pub struct LazyBinaryTransformLast<I, T, S1T, S2T>(pub LazyVecFrom2<I, T, I, S1T, I, S2T>)
where
I: VecIndex,
T: ComputedVecValue + JsonSchema,
S1T: ComputedVecValue,
S2T: ComputedVecValue;
impl<I, T, S1T, S2T> LazyTransform2Last<I, T, S1T, S2T>
impl<I, T, S1T, S2T> LazyBinaryTransformLast<I, T, S1T, S2T>
where
I: VecIndex,
T: ComputedVecValue + JsonSchema + 'static,
@@ -12,14 +12,14 @@ const VERSION: Version = Version::ZERO;
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(wrap = "sum")]
pub struct LazyTransform2Sum<I, T, S1T, S2T>(pub LazyVecFrom2<I, T, I, S1T, I, S2T>)
pub struct LazyBinaryTransformSum<I, T, S1T, S2T>(pub LazyVecFrom2<I, T, I, S1T, I, S2T>)
where
I: VecIndex,
T: ComputedVecValue + PartialOrd + JsonSchema,
S1T: ComputedVecValue,
S2T: ComputedVecValue;
impl<I, T, S1T, S2T> LazyTransform2Sum<I, T, S1T, S2T>
impl<I, T, S1T, S2T> LazyBinaryTransformSum<I, T, S1T, S2T>
where
I: VecIndex,
T: ComputedVecValue + JsonSchema + 'static,
@@ -10,7 +10,7 @@ use vecdb::{
use crate::internal::{ComputedVecValue, LazyFull, LastVec, SumCum};
#[derive(Clone, Traversable)]
pub struct LazyTransform2SumCum<I, T, S1T = T, S2T = T>
pub struct LazyBinaryTransformSumCum<I, T, S1T = T, S2T = T>
where
I: VecIndex,
T: ComputedVecValue + JsonSchema,
@@ -21,7 +21,7 @@ where
pub cumulative: LazyVecFrom2<I, T, I, S1T, I, S2T>,
}
impl<I, T, S1T, S2T> LazyTransform2SumCum<I, T, S1T, S2T>
impl<I, T, S1T, S2T> LazyBinaryTransformSumCum<I, T, S1T, S2T>
where
I: VecIndex,
T: ComputedVecValue + JsonSchema + 'static,
@@ -7,22 +7,22 @@ use vecdb::{Database, Exit, IterableBoxedVec};
use crate::{
ComputeIndexes, indexes,
internal::{ComputedDateLast, DerivedDateLast, LazyDateLast, SatsToBitcoin},
internal::{ComputedDateLast, LazyPeriodsLast, LazyDateLast, SatsToBitcoin},
price,
traits::ComputeFromBitcoin,
utils::OptionExt,
};
#[derive(Clone, Traversable)]
pub struct ValueDerivedDateLast {
pub sats: DerivedDateLast<Sats>,
pub struct ValueLazyPeriodsLast {
pub sats: LazyPeriodsLast<Sats>,
pub bitcoin: LazyDateLast<Bitcoin, Sats>,
pub dollars: Option<ComputedDateLast<Dollars>>,
}
const VERSION: Version = Version::ZERO;
impl ValueDerivedDateLast {
impl ValueLazyPeriodsLast {
pub fn from_source(
db: &Database,
name: &str,
@@ -31,7 +31,7 @@ impl ValueDerivedDateLast {
compute_dollars: bool,
indexes: &indexes::Vecs,
) -> Result<Self> {
let sats = DerivedDateLast::from_source(name, version + VERSION, source.clone(), indexes);
let sats = LazyPeriodsLast::from_source(name, version + VERSION, source.clone(), indexes);
let bitcoin = LazyDateLast::from_derived::<SatsToBitcoin>(
&format!("{name}_btc"),
@@ -8,7 +8,7 @@ use vecdb::{Database, EagerVec, Exit, ImportableVec, IterableCloneableVec, PcoVe
use crate::{ComputeIndexes, indexes, price};
use super::ValueDerivedDateLast;
use super::ValueLazyPeriodsLast;
#[derive(Clone, Deref, DerefMut, Traversable)]
#[traversable(merge)]
@@ -17,7 +17,7 @@ pub struct ValueDateLast {
pub sats_dateindex: EagerVec<PcoVec<DateIndex, Sats>>,
#[deref]
#[deref_mut]
pub rest: ValueDerivedDateLast,
pub rest: ValueLazyPeriodsLast,
}
const VERSION: Version = Version::ZERO;
@@ -32,7 +32,7 @@ impl ValueDateLast {
) -> Result<Self> {
let sats_dateindex = EagerVec::forced_import(db, name, version + VERSION)?;
let rest = ValueDerivedDateLast::from_source(
let rest = ValueLazyPeriodsLast::from_source(
db,
name,
sats_dateindex.boxed_clone(),
@@ -8,7 +8,7 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, IterableVec,
use crate::{
ComputeIndexes, indexes,
internal::{
ClosePriceTimesSats, DerivedComputedBlockSumCum, LazyBlockSumCum, LazyComputedBlockSumCum,
ClosePriceTimesSats, ComputedDerivedBlockSumCum, LazyBlockSumCum, LazyComputedBlockSumCum,
SatsToBitcoin,
},
price,
@@ -17,7 +17,7 @@ use crate::{
/// Value wrapper for derived SumCum (derives from external height source).
#[derive(Clone, Traversable)]
pub struct DerivedValueBlockSumCum {
pub sats: DerivedComputedBlockSumCum<Sats>,
pub sats: ComputedDerivedBlockSumCum<Sats>,
pub bitcoin: LazyBlockSumCum<Bitcoin, Sats>,
pub dollars: Option<LazyComputedBlockSumCum<Dollars, Close<Dollars>, Sats>>,
}
@@ -35,7 +35,7 @@ impl DerivedValueBlockSumCum {
) -> Result<Self> {
let v = version + VERSION;
let sats = DerivedComputedBlockSumCum::forced_import(
let sats = ComputedDerivedBlockSumCum::forced_import(
db,
name,
sats_source.boxed_clone(),
@@ -11,7 +11,7 @@ use vecdb::{Database, Exit, IterableBoxedVec, IterableCloneableVec, LazyVecFrom3
use crate::{
ComputeIndexes, indexes,
internal::{DerivedDateFull, Full, LazyFull, Stats},
internal::{LazyPeriodsFull, Full, LazyFull, Stats},
};
/// Lazy dollars at TxIndex: `sats * price[height]`
@@ -29,7 +29,7 @@ pub struct DollarsTxFull {
pub dateindex: Stats<DateIndex, Dollars>,
#[deref]
#[deref_mut]
pub dates: DerivedDateFull<Dollars>,
pub dates: LazyPeriodsFull<Dollars>,
}
const VERSION: Version = Version::ZERO;
@@ -63,7 +63,7 @@ impl DollarsTxFull {
indexes.difficultyepoch.identity.boxed_clone(),
);
let dates = DerivedDateFull::from_sources(
let dates = LazyPeriodsFull::from_sources(
name,
v,
dateindex.average.0.boxed_clone(),
+3194 -2317
View File
File diff suppressed because it is too large Load Diff
+122 -122
View File
@@ -2117,22 +2117,6 @@ class ClassAveragePricePattern(Generic[T]):
self._2024: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2024_average_price'))
self._2025: MetricPattern4[T] = MetricPattern4(client, _m(acc, '2025_average_price'))
class RelativePattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap'))
self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap'))
self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl'))
self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply'))
self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply'))
self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply'))
self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply'))
self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = MetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply'))
self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap'))
self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap'))
class RelativePattern2:
"""Pattern struct for repeated tree structure."""
@@ -2149,6 +2133,22 @@ class RelativePattern2:
self.unrealized_profit_rel_to_own_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_market_cap'))
self.unrealized_profit_rel_to_own_total_unrealized_pnl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_own_total_unrealized_pnl'))
class RelativePattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.neg_unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'neg_unrealized_loss_rel_to_market_cap'))
self.net_unrealized_pnl_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'net_unrealized_pnl_rel_to_market_cap'))
self.nupl: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'nupl'))
self.supply_in_loss_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_circulating_supply'))
self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_loss_rel_to_own_supply'))
self.supply_in_profit_rel_to_circulating_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_circulating_supply'))
self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'supply_in_profit_rel_to_own_supply'))
self.supply_rel_to_circulating_supply: MetricPattern4[StoredF64] = MetricPattern4(client, _m(acc, 'supply_rel_to_circulating_supply'))
self.unrealized_loss_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_loss_rel_to_market_cap'))
self.unrealized_profit_rel_to_market_cap: MetricPattern1[StoredF32] = MetricPattern1(client, _m(acc, 'unrealized_profit_rel_to_market_cap'))
class AddrCountPattern:
"""Pattern struct for repeated tree structure."""
@@ -2164,21 +2164,6 @@ class AddrCountPattern:
self.p2wpkh: MetricPattern1[StoredU64] = MetricPattern1(client, (f'p2wpkh_addr_{{acc}}' if acc else 'p2wpkh_addr'))
self.p2wsh: MetricPattern1[StoredU64] = MetricPattern1(client, (f'p2wsh_addr_{{acc}}' if acc else 'p2wsh_addr'))
class OhlcPattern(Generic[T]):
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.dateindex: MetricPattern7[T] = MetricPattern7(client, acc)
self.decade: MetricPattern8[T] = MetricPattern8(client, acc)
self.difficultyepoch: MetricPattern9[T] = MetricPattern9(client, acc)
self.height: MetricPattern12[T] = MetricPattern12(client, acc)
self.month: MetricPattern14[T] = MetricPattern14(client, acc)
self.quarter: MetricPattern26[T] = MetricPattern26(client, acc)
self.semester: MetricPattern27[T] = MetricPattern27(client, acc)
self.week: MetricPattern30[T] = MetricPattern30(client, acc)
self.year: MetricPattern31[T] = MetricPattern31(client, acc)
class FeeRatePattern(Generic[T]):
"""Pattern struct for repeated tree structure."""
@@ -2194,6 +2179,21 @@ class FeeRatePattern(Generic[T]):
self.pct90: MetricPattern12[T] = MetricPattern12(client, _m(acc, 'pct90'))
self.txindex: MetricPattern28[T] = MetricPattern28(client, acc)
class OhlcPattern(Generic[T]):
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.dateindex: MetricPattern7[T] = MetricPattern7(client, acc)
self.decade: MetricPattern8[T] = MetricPattern8(client, acc)
self.difficultyepoch: MetricPattern9[T] = MetricPattern9(client, acc)
self.height: MetricPattern12[T] = MetricPattern12(client, acc)
self.month: MetricPattern14[T] = MetricPattern14(client, acc)
self.quarter: MetricPattern26[T] = MetricPattern26(client, acc)
self.semester: MetricPattern27[T] = MetricPattern27(client, acc)
self.week: MetricPattern30[T] = MetricPattern30(client, acc)
self.year: MetricPattern31[T] = MetricPattern31(client, acc)
class _0satsPattern:
"""Pattern struct for repeated tree structure."""
@@ -2208,6 +2208,19 @@ class _0satsPattern:
self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply'))
self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc)
class _0satsPattern2:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.activity: ActivityPattern2 = ActivityPattern2(client, acc)
self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc)
self.outputs: OutputsPattern = OutputsPattern(client, acc)
self.realized: RealizedPattern = RealizedPattern(client, acc)
self.relative: RelativePattern4 = RelativePattern4(client, _m(acc, 'supply_in'))
self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply'))
self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc)
class UnrealizedPattern:
"""Pattern struct for repeated tree structure."""
@@ -2234,6 +2247,19 @@ class _100btcPattern:
self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply'))
self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc)
class _10yTo12yPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.activity: ActivityPattern2 = ActivityPattern2(client, acc)
self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, acc)
self.outputs: OutputsPattern = OutputsPattern(client, acc)
self.realized: RealizedPattern2 = RealizedPattern2(client, acc)
self.relative: RelativePattern2 = RelativePattern2(client, acc)
self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply'))
self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc)
class _10yPattern:
"""Pattern struct for repeated tree structure."""
@@ -2260,39 +2286,13 @@ class PeriodCagrPattern:
self._6y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'6y_{{acc}}' if acc else '6y'))
self._8y: MetricPattern4[StoredF32] = MetricPattern4(client, (f'8y_{{acc}}' if acc else '8y'))
class _0satsPattern2:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.activity: ActivityPattern2 = ActivityPattern2(client, acc)
self.cost_basis: CostBasisPattern = CostBasisPattern(client, acc)
self.outputs: OutputsPattern = OutputsPattern(client, acc)
self.realized: RealizedPattern = RealizedPattern(client, acc)
self.relative: RelativePattern4 = RelativePattern4(client, _m(acc, 'supply_in'))
self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply'))
self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc)
class _10yTo12yPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.activity: ActivityPattern2 = ActivityPattern2(client, acc)
self.cost_basis: CostBasisPattern2 = CostBasisPattern2(client, acc)
self.outputs: OutputsPattern = OutputsPattern(client, acc)
self.realized: RealizedPattern2 = RealizedPattern2(client, acc)
self.relative: RelativePattern2 = RelativePattern2(client, acc)
self.supply: SupplyPattern2 = SupplyPattern2(client, _m(acc, 'supply'))
self.unrealized: UnrealizedPattern = UnrealizedPattern(client, acc)
class BitcoinPattern(Generic[T]):
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average'))
self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative'))
self.cumulative: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'cumulative'))
self.height: MetricPattern12[T] = MetricPattern12(client, acc)
self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max'))
self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min'))
@@ -2304,12 +2304,12 @@ class SizePattern(Generic[T]):
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.average: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'average'))
self.average: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'average'))
self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative'))
self.max: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'max'))
self.min: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'min'))
self.max: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'max'))
self.min: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'min'))
self.percentiles: PercentilesPattern[T] = PercentilesPattern(client, acc)
self.sum: MetricPattern2[T] = MetricPattern2(client, _m(acc, 'sum'))
self.sum: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'sum'))
class ActivityPattern2:
"""Pattern struct for repeated tree structure."""
@@ -2343,16 +2343,6 @@ class DateindexPattern2:
self.low: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'low_cents'))
self.open: MetricPattern7[Cents] = MetricPattern7(client, _m(acc, 'open_cents'))
class SplitPattern2(Generic[T]):
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.close: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'close'))
self.high: HighPattern[T] = HighPattern(client, _m(acc, 'high'))
self.low: HighPattern[T] = HighPattern(client, _m(acc, 'low'))
self.open: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'open'))
class HighPattern(Generic[T]):
"""Pattern struct for repeated tree structure."""
@@ -2363,6 +2353,16 @@ class HighPattern(Generic[T]):
self.height: MetricPattern12[T] = MetricPattern12(client, acc)
self.rest: MetricPattern5[T] = MetricPattern5(client, _m(acc, 'max'))
class SplitPattern2(Generic[T]):
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.close: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'close'))
self.high: HighPattern[T] = HighPattern(client, _m(acc, 'high'))
self.low: HighPattern[T] = HighPattern(client, _m(acc, 'low'))
self.open: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'open'))
class _24hCoinbaseSumPattern:
"""Pattern struct for repeated tree structure."""
@@ -2372,33 +2372,6 @@ class _24hCoinbaseSumPattern:
self.dollars: MetricPattern12[Dollars] = MetricPattern12(client, _m(acc, 'usd'))
self.sats: MetricPattern12[Sats] = MetricPattern12(client, acc)
class SegwitAdoptionPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.cumulative: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'cumulative'))
self.height: MetricPattern12[StoredF32] = MetricPattern12(client, acc)
self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'sum'))
class CostBasisPattern2:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.max: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'max_cost_basis'))
self.min: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'min_cost_basis'))
self.percentiles: PercentilesPattern2 = PercentilesPattern2(client, _m(acc, 'cost_basis'))
class UnclaimedRewardsPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.bitcoin: BlockCountPattern[Bitcoin] = BlockCountPattern(client, _m(acc, 'btc'))
self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd'))
self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc)
class CoinbasePattern:
"""Pattern struct for repeated tree structure."""
@@ -2408,37 +2381,32 @@ class CoinbasePattern:
self.dollars: BitcoinPattern[Dollars] = BitcoinPattern(client, _m(acc, 'usd'))
self.sats: BitcoinPattern[Sats] = BitcoinPattern(client, acc)
class RelativePattern4:
class UnclaimedRewardsPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'loss_rel_to_own_supply'))
self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'profit_rel_to_own_supply'))
self.bitcoin: BlockCountPattern[Bitcoin] = BlockCountPattern(client, _m(acc, 'btc'))
self.dollars: BlockCountPattern[Dollars] = BlockCountPattern(client, _m(acc, 'usd'))
self.sats: BlockCountPattern[Sats] = BlockCountPattern(client, acc)
class _1dReturns1mSdPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd'))
self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma'))
class CostBasisPattern:
class CostBasisPattern2:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.max: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'max_cost_basis'))
self.min: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'min_cost_basis'))
self.percentiles: PercentilesPattern2 = PercentilesPattern2(client, _m(acc, 'cost_basis'))
class SupplyPattern2:
class SegwitAdoptionPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.halved: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'half'))
self.total: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, acc)
self.cumulative: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'cumulative'))
self.height: MetricPattern12[StoredF32] = MetricPattern12(client, acc)
self.sum: MetricPattern2[StoredF32] = MetricPattern2(client, _m(acc, 'sum'))
class SatsPattern:
"""Pattern struct for repeated tree structure."""
@@ -2448,6 +2416,38 @@ class SatsPattern:
self.ohlc: OhlcPattern[OHLCSats] = OhlcPattern(client, _m(acc, 'ohlc_sats'))
self.split: SplitPattern2[Sats] = SplitPattern2(client, _m(acc, 'sats'))
class SupplyPattern2:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.halved: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, _m(acc, 'half'))
self.total: _24hCoinbaseSumPattern = _24hCoinbaseSumPattern(client, acc)
class CostBasisPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.max: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'max_cost_basis'))
self.min: MetricPattern1[Dollars] = MetricPattern1(client, _m(acc, 'min_cost_basis'))
class _1dReturns1mSdPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.sd: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sd'))
self.sma: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'sma'))
class RelativePattern4:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.supply_in_loss_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'loss_rel_to_own_supply'))
self.supply_in_profit_rel_to_own_supply: MetricPattern1[StoredF64] = MetricPattern1(client, _m(acc, 'profit_rel_to_own_supply'))
class BlockCountPattern(Generic[T]):
"""Pattern struct for repeated tree structure."""
@@ -2456,13 +2456,6 @@ class BlockCountPattern(Generic[T]):
self.cumulative: MetricPattern1[T] = MetricPattern1(client, _m(acc, 'cumulative'))
self.sum: MetricPattern1[T] = MetricPattern1(client, acc)
class RealizedPriceExtraPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio'))
class OutputsPattern:
"""Pattern struct for repeated tree structure."""
@@ -2470,12 +2463,19 @@ class OutputsPattern:
"""Create pattern node with accumulated metric name."""
self.utxo_count: MetricPattern1[StoredU64] = MetricPattern1(client, _m(acc, 'utxo_count'))
class RealizedPriceExtraPattern:
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.ratio: MetricPattern4[StoredF32] = MetricPattern4(client, _m(acc, 'ratio'))
class EmptyPattern(Generic[T]):
"""Pattern struct for repeated tree structure."""
def __init__(self, client: BrkClientBase, acc: str):
"""Create pattern node with accumulated metric name."""
self.identity: MetricPattern18[T] = MetricPattern18(client, acc)
self.identity: MetricPattern25[T] = MetricPattern25(client, acc)
# Catalog tree classes
+2 -2
View File
@@ -1563,7 +1563,7 @@
<link rel="modulepreload" href="/scripts/entry.15f91516.js">
<link rel="modulepreload" href="/scripts/lazy.cdb73318.js">
<link rel="modulepreload" href="/scripts/main.60f735cb.js">
<link rel="modulepreload" href="/scripts/modules/brk-client/index.df202eed.js">
<link rel="modulepreload" href="/scripts/modules/brk-client/index.ab5c0c96.js">
<link rel="modulepreload" href="/scripts/modules/lean-qr/2.6.1/index.09195c13.mjs">
<link rel="modulepreload" href="/scripts/modules/leeoniya-ufuzzy/1.0.19/dist/uFuzzy.803b7fb0.mjs">
<link rel="modulepreload" href="/scripts/modules/lightweight-charts/5.0.9/dist/lightweight-charts.standalone.production.1e264451.mjs">
@@ -1633,7 +1633,7 @@
"/scripts/entry.js": "/scripts/entry.15f91516.js",
"/scripts/lazy.js": "/scripts/lazy.cdb73318.js",
"/scripts/main.js": "/scripts/main.60f735cb.js",
"/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.df202eed.js",
"/scripts/modules/brk-client/index.js": "/scripts/modules/brk-client/index.ab5c0c96.js",
"/scripts/modules/lean-qr/2.6.1/index.mjs": "/scripts/modules/lean-qr/2.6.1/index.09195c13.mjs",
"/scripts/modules/leeoniya-ufuzzy/1.0.19/dist/uFuzzy.mjs": "/scripts/modules/leeoniya-ufuzzy/1.0.19/dist/uFuzzy.803b7fb0.mjs",
"/scripts/modules/lightweight-charts/5.0.9/dist/lightweight-charts.standalone.production.mjs": "/scripts/modules/lightweight-charts/5.0.9/dist/lightweight-charts.standalone.production.1e264451.mjs",