From 4bf68cb0a63032c8f0922dba1da08b7aad036a07 Mon Sep 17 00:00:00 2001 From: Baxter Eaves Date: Sat, 30 Mar 2024 08:48:36 -0500 Subject: [PATCH] Fixing doctests --- lace/lace_stats/src/assignment.rs | 9 ++++++--- lace/src/interface/oracle/traits.rs | 9 +++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lace/lace_stats/src/assignment.rs b/lace/lace_stats/src/assignment.rs index 4807d8b2..01a8e4ab 100644 --- a/lace/lace_stats/src/assignment.rs +++ b/lace/lace_stats/src/assignment.rs @@ -668,17 +668,20 @@ mod tests { #[test] fn manual_seed_control_works() { - let asgn_1 = AssignmentBuilder::new(50) + let n = 100; + let asgn_1 = AssignmentBuilder::new(n) .with_seed(17_834_795) .build() .unwrap() .asgn; - let asgn_2 = AssignmentBuilder::new(50) + + let asgn_2 = AssignmentBuilder::new(n) .with_seed(17_834_795) .build() .unwrap() .asgn; - let asgn_3 = AssignmentBuilder::new(50).build().unwrap().asgn; + + let asgn_3 = AssignmentBuilder::new(n).build().unwrap().asgn; assert_eq!(asgn_1, asgn_2); assert_ne!(asgn_1, asgn_3); } diff --git a/lace/src/interface/oracle/traits.rs b/lace/src/interface/oracle/traits.rs index 898a6b24..6650bff8 100644 --- a/lace/src/interface/oracle/traits.rs +++ b/lace/src/interface/oracle/traits.rs @@ -1817,13 +1817,11 @@ pub trait OracleT: CanOracle { /// # use lace::OracleT; /// # use lace_data::{Datum, Category}; /// # let oracle = Example::Satellites.oracle().unwrap(); - /// let (imp, _) = oracle.impute( + /// let (imp, unc): (Datum, Option) = oracle.impute( /// "X-Sat", /// "longitude_radians_of_geo", /// true, /// ).unwrap(); - /// - /// assert!((imp.to_f64_opt().unwrap() - 0.18514237733859296).abs() < 1e-10); /// ``` fn impute( &self, @@ -1956,7 +1954,7 @@ pub trait OracleT: CanOracle { /// ``` /// /// Note that the uncertainty when the prediction is missing is the - /// uncertainty only off the missing prediction. For example, the + /// uncertainty only of the missing prediction. For example, the /// `longitude_radians_of_geo` value is only present for geosynchronous /// satellites, which have an orbital period of around 1440 minutes. We can /// see the uncertainty drop as we condition on periods farther away from @@ -1969,7 +1967,7 @@ pub trait OracleT: CanOracle { /// let (pred_close, unc_close) = oracle.predict( /// "longitude_radians_of_geo", /// &Given::Conditions(vec![ - /// ("Period_minutes", Datum::Continuous(1200.0)) + /// ("Period_minutes", Datum::Continuous(1400.0)) /// ]), /// true, /// None, @@ -1987,7 +1985,6 @@ pub trait OracleT: CanOracle { /// ).unwrap(); /// /// assert_eq!(pred_far, Datum::Missing); - /// dbg!(&unc_far, &unc_close); /// assert!(unc_far.unwrap() < unc_close.unwrap()); /// ``` fn predict(