Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tracing-subscriber = { version = "0.3.19", features = [
"time",
] }
faer = "0.24.0"
pharmsol = "=0.25"
pharmsol = "=0.26"
rand = "0.9.0"
anyhow = "1.0.100"
rayon = "1.10.0"
Expand Down
1 change: 0 additions & 1 deletion benches/bimodal_ke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ fn create_equation() -> equation::ODE {
y[1] = x[0] / v;
},
)
.with_default_cache()
}

fn create_parameters() -> Parameters {
Expand Down
3 changes: 1 addition & 2 deletions examples/bestdose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ fn main() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
}
.with_default_cache();
};

let params = Parameters::new()
.add("ke", 0.001, 3.0)
Expand Down
3 changes: 1 addition & 2 deletions examples/bestdose_auc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ fn main() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
}
.with_default_cache();
};

// Minimal parameter ranges
let params = Parameters::new()
Expand Down
3 changes: 1 addition & 2 deletions examples/bestdose_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ fn main() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
}
.with_default_cache();
};

let params = Parameters::new()
.add("ke", 0.001, 3.0)
Expand Down
3 changes: 1 addition & 2 deletions examples/bimodal_ke/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ fn main() -> Result<()> {
y[1] = x[0] / v;
},
}
.with_solver(OdeSolver::ExplicitRk(ExplicitRkTableau::Tsit45))
.with_default_cache();
.with_solver(OdeSolver::ExplicitRk(ExplicitRkTableau::Tsit45));

let params = Parameters::new()
.add("ke", 0.001, 3.0)
Expand Down
3 changes: 1 addition & 2 deletions examples/drusano/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ fn main() -> Result<()> {
y[3] = x[3].log10();
y[4] = x[4].log10();
},
}
.with_default_cache();
};

let params = Parameters::new()
.add("v1", 5.0, 160.0)
Expand Down
3 changes: 1 addition & 2 deletions examples/iov/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ fn main() -> Result<()> {
)
.with_nstates(2)
.with_ndrugs(1)
.with_nout(1)
.with_default_cache();
.with_nout(1);

let params = Parameters::new().add("ke0", 0.001, 2.0);

Expand Down
3 changes: 1 addition & 2 deletions examples/meta/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ fn main() {
y[1] = x[0] / v;
y[2] = x[1] / v2;
},
}
.with_default_cache();
};

let params = Parameters::new()
.add("cls", 0.1, 10.0)
Expand Down
3 changes: 1 addition & 2 deletions examples/neely/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ fn main() {
y[2] = x[2] / vm1;
y[3] = x[3] / vm2;
},
}
.with_default_cache();
};

let params = Parameters::new()
.add("cls", 0.0, 0.4)
Expand Down
3 changes: 1 addition & 2 deletions examples/new_iov/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ fn main() {
)
.with_nstates(2)
.with_ndrugs(1)
.with_nout(1)
.with_default_cache();
.with_nout(1);

let params = Parameters::new()
.add("ke0", 0.0001, 2.4)
Expand Down
3 changes: 1 addition & 2 deletions examples/theophylline/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ fn main() {
fetch_params!(p, _ka, _ke, v);
y[0] = x[1] * 1000.0 / v;
},
)
.with_default_cache();
);

let params = Parameters::new()
.add("ka", 0.001, 3.0)
Expand Down
3 changes: 1 addition & 2 deletions examples/two_eq_lag/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ fn main() {
fetch_params!(p, _ka, _ke, _tlag, v);
y[1] = x[1] / v;
},
}
.with_default_cache();
};
// let eq = Equation::new_analytical(
// one_compartment_with_absorption,
// |_p, _cov| {},
Expand Down
3 changes: 1 addition & 2 deletions examples/vanco.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ fn main() {
out: |x, _p, _t, _cov, y| {
y[0] = x[1];
},
}
.with_default_cache();
};
// same eq but analytical
// let eq = Equation::new_analytical(
// two_compartments,
Expand Down
3 changes: 1 addition & 2 deletions examples/vanco_sde/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ fn main() {
y[0] = x[1] / (vol * wt);
},
100,
)
.with_default_cache();
);

// let ode = equation::ODE::new(
// |x, p, _t, dx, _rateiv, _cov| {
Expand Down
43 changes: 14 additions & 29 deletions tests/bestdose_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ fn test_infusion_mask_inclusion() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -137,8 +136,7 @@ fn test_fixed_infusion_preservation() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new()
.add("ke", 0.001, 3.0)
Expand Down Expand Up @@ -231,8 +229,7 @@ fn test_dose_count_validation() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);
let ems = AssayErrorModels::new().add(
Expand Down Expand Up @@ -302,8 +299,7 @@ fn test_empty_observations_validation() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);
let ems = AssayErrorModels::new().add(
Expand Down Expand Up @@ -363,8 +359,7 @@ fn test_basic_auc_mode() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -449,8 +444,7 @@ fn test_infusion_auc_mode() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -554,8 +548,7 @@ fn test_multi_outeq_auc_mode() -> Result<()> {
y[0] = x[0] / v; // outeq 0: concentration
y[1] = x[0]; // outeq 1: amount
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -625,8 +618,7 @@ fn test_multi_outeq_auc_optimization() -> Result<()> {
y[0] = x[0] / v;
y[1] = x[0];
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);
let error_model = AssayErrorModel::additive(ErrorPoly::new(0.0, 5.0, 0.0, 0.0), 0.0);
Expand Down Expand Up @@ -711,8 +703,7 @@ fn test_auc_from_zero_single_dose() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.2, 0.4).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -796,8 +787,7 @@ fn test_auc_from_last_dose_maintenance() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.2, 0.4).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -885,8 +875,7 @@ fn test_auc_modes_comparison() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.3, 0.3).add("v", 50.0, 50.0);

Expand Down Expand Up @@ -1015,8 +1004,7 @@ fn test_auc_from_last_dose_multiple_observations() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.2, 0.4).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -1110,8 +1098,7 @@ fn test_auc_from_last_dose_no_prior_dose() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.2, 0.4).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -1200,8 +1187,7 @@ fn test_dose_range_bounds_respected() -> Result<()> {
fetch_params!(p, _ke, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

let params = Parameters::new().add("ke", 0.1, 0.5).add("v", 40.0, 60.0);

Expand Down Expand Up @@ -1295,7 +1281,6 @@ fn one_compartment_model() -> pharmsol::ODE {
y[0] = x[0] / v;
},
)
.with_default_cache()
}

/// Helper to build minimal settings for tests (no posterior refinement)
Expand Down
9 changes: 3 additions & 6 deletions tests/onecomp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ fn test_one_compartment_npag() -> Result<()> {
fetch_params!(p, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

// Define parameters
let params = Parameters::new().add("ke", 0.1, 1.0).add("v", 1.0, 20.0);
Expand Down Expand Up @@ -84,8 +83,7 @@ fn test_one_compartment_npod() -> Result<()> {
fetch_params!(p, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

// Define parameters
let params = Parameters::new().add("ke", 0.1, 1.0).add("v", 1.0, 20.0);
Expand Down Expand Up @@ -152,8 +150,7 @@ fn test_one_compartment_postprob() -> Result<()> {
fetch_params!(p, v);
y[0] = x[0] / v;
},
)
.with_default_cache();
);

// Define parameters
let params = Parameters::new().add("ke", 0.1, 1.0).add("v", 1.0, 20.0);
Expand Down
Loading