Module metadata
Expand description
Metadata builders and validated metadata views for handwritten models.
Use this module when a handwritten crate::ODE, crate::Analytical, or
crate::SDE model should expose the same public names that appear in data
rows, subject builders, or parsed files.
Metadata gives names to parameters, covariates, states, routes, and outputs.
After validation, the execution layer can resolve public labels such as
"iv" and "cp" against those declarations before simulation.
Without metadata, handwritten models fall back to numeric labels. With metadata, labels are matched by name.
§Example
use pharmsol::{metadata, ModelKind};
let metadata = metadata::new("one_cmt")
.kind(ModelKind::Ode)
.parameters(["cl", "v"])
.states(["central"])
.outputs(["cp"])
.route(metadata::Route::infusion("iv").to_state("central"))
.validate()
.unwrap();
assert_eq!(metadata.name(), "one_cmt");
assert_eq!(metadata.route("iv").unwrap().destination(), "central");
assert!(metadata.output("cp").is_some());Structs§
- Covariate
- One named covariate plus interpolation semantics.
- Model
Metadata - Builder for handwritten model metadata.
- Output
- One named output in model order.
- Parameter
- One named parameter in model order.
- Route
- One named route declaration.
- State
- One named state in model order.
- Validated
Model Metadata - Validated metadata view used by the execution layer.
- Validated
Route - One validated route declaration with resolved execution details.
Enums§
- Model
Metadata Error - Validation errors for handwritten model metadata.
- Name
Domain - Name domain used in duplicate-name validation messages.
- Route
Input Policy - How route inputs should be interpreted by the execution layer.
- Route
Kind - Route declaration kind.
Functions§
- new
- Shorthand for
ModelMetadata::new.