-
Notifications
You must be signed in to change notification settings - Fork 0
Transforms mod #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transforms mod #36
Conversation
…es. get_model_summary -> summary(mod)
update hyperion_nonmem_model generics and cleaned up token/token_rang…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Review: Transforms Mod (v0.2.0)
Summary
This PR introduces a comprehensive parameter comment and metadata system for NONMEM models
What This PR Does
1. Parameter Comment System (S7 Classes)
Introduces a structured metadata system built on S7 classes:
ThetaComment,OmegaComment,SigmaComment: Per-parameter containers storingname,display,description,unit(THETA/SIGMA),parameterization, andassociated_theta(OMEGA only)ModelComments: Aggregate container that validates cross-references (e.g., OMEGAassociated_thetanames must exist in theta)- Source tracking: Each field tracks its provenance (model file, lookup file, user-supplied, or default)
2. Comment Parsing Infrastructure
Two parsing modes controlled via pharos.toml:
- type1 mode: pharos supported type1 comments
- raw mode (default): Flexible parsing from free-form comment text
Entry point is get_model_parameter_info() which returns a ModelComments object.
3. TOML Lookup Enrichment
apply_lookup()/apply_lookup_defaults()fill missing fields of a ModelComments object from external TOML file- Case-insensitive matching by parameter name or NONMEM name
- Provenance tracking records which lookup file provided each value
4. Pharos Parameter Transform Calculations
New functions in src/rust/nonmem/src/output_files/transforms.rs:
compute_cv(): Coefficient of variation with transform-aware formulascompute_rse(): Relative standard error percentagecompute_ci(): Confidence intervals with optional back-transformationtransform_value(): Back-transform estimates to natural scale
All support vectorized inputs with length-1 recycling semantics.
5. Query Helpers
get_parameter_names(): NONMEM → user name/display mappingget_parameter_transform()/get_parameter_unit(): Per-parameter metadata retrievalget_theta_names()/get_eta_labels(): Label generation for tables/plots
6. Model Method Improvements
summary.hyperion_nonmem_model()added as S3 methodstr.hyperion_nonmem_model()hides verbose token fields$and[[accessors prevent direct access to internal token fields- Improved print formatting with
build_model_display_parts()refactor
No description provided.