Skip to content

Commit

Permalink
Fixing doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
Baxter Eaves committed Mar 30, 2024
1 parent 612ee9e commit 4bf68cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 6 additions & 3 deletions lace/lace_stats/src/assignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
9 changes: 3 additions & 6 deletions lace/src/interface/oracle/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f64>) = oracle.impute(
/// "X-Sat",
/// "longitude_radians_of_geo",
/// true,
/// ).unwrap();
///
/// assert!((imp.to_f64_opt().unwrap() - 0.18514237733859296).abs() < 1e-10);
/// ```
fn impute<RIx: RowIndex, CIx: ColumnIndex>(
&self,
Expand Down Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -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<Ix: ColumnIndex, GIx: ColumnIndex>(
Expand Down

0 comments on commit 4bf68cb

Please sign in to comment.