mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-12 11:38:13 -07:00
global: snapshot
This commit is contained in:
@@ -10,6 +10,7 @@ pub struct Windows<A> {
|
||||
|
||||
impl<A> Windows<A> {
|
||||
pub const SUFFIXES: [&'static str; 4] = ["24h", "1w", "1m", "1y"];
|
||||
pub const DAYS: [usize; 4] = [1, 7, 30, 365];
|
||||
|
||||
pub fn try_from_fn<E>(
|
||||
mut f: impl FnMut(&str) -> std::result::Result<A, E>,
|
||||
|
||||
@@ -136,7 +136,7 @@ impl RatioPerBlockPercentiles {
|
||||
|
||||
{
|
||||
let _lock = exit.lock();
|
||||
self.mut_pct_vecs().try_for_each(|v| v.flush())?;
|
||||
self.mut_pct_vecs().try_for_each(|v| v.write().map(|_| ()))?;
|
||||
}
|
||||
|
||||
// Cents bands
|
||||
|
||||
@@ -162,7 +162,7 @@ impl StdDevPerBlockExtended {
|
||||
|
||||
{
|
||||
let _lock = exit.lock();
|
||||
self.mut_band_height_vecs().try_for_each(|v| v.flush())?;
|
||||
self.mut_band_height_vecs().try_for_each(|v| v.write().map(|_| ()))?;
|
||||
}
|
||||
|
||||
self.zscore.height.compute_zscore(
|
||||
|
||||
@@ -30,6 +30,11 @@ pub trait SqrtDays {
|
||||
const FACTOR: f32;
|
||||
}
|
||||
|
||||
pub struct Days1;
|
||||
impl SqrtDays for Days1 {
|
||||
const FACTOR: f32 = 1.0; // 1.0_f32.sqrt()
|
||||
}
|
||||
|
||||
pub struct Days7;
|
||||
impl SqrtDays for Days7 {
|
||||
const FACTOR: f32 = 2.6457513; // 7.0_f32.sqrt()
|
||||
|
||||
@@ -20,7 +20,7 @@ pub use currency::{
|
||||
SatsToBitcoin, SatsToCents,
|
||||
};
|
||||
pub use derived::{
|
||||
Days7, Days30, Days365, DaysToYears, PerSec, PriceTimesRatioBp32Cents, PriceTimesRatioCents,
|
||||
Days1, Days7, Days30, Days365, DaysToYears, PerSec, PriceTimesRatioBp32Cents, PriceTimesRatioCents,
|
||||
RatioCents64, TimesSqrt,
|
||||
};
|
||||
pub use ratio::{
|
||||
|
||||
Reference in New Issue
Block a user