Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fcd44c9
wip
mduncans Mar 26, 2026
ed03605
update pharos dep
mduncans Mar 26, 2026
c8ba02f
update mod with data for testing
mduncans Mar 27, 2026
d8c5310
move to nmparser
mduncans Apr 2, 2026
97b5465
update documentation
mduncans Apr 2, 2026
d359453
update branch and render diagnostics
mduncans Apr 7, 2026
1bccf40
move to new pharos branch
mduncans Apr 8, 2026
fc054ad
update pharos dep
mduncans Apr 8, 2026
43f5520
update pharos/extendr remove panic hook
mduncans Apr 10, 2026
7b51210
clean panic_message
mduncans Apr 10, 2026
61763cb
update parsed comments pharos branch
mduncans Apr 20, 2026
6d7d111
update comments to only use pharos parsed comments
mduncans Apr 20, 2026
c9e49cf
remove nmparser module moving model reading back to nonmem crate
mduncans Apr 20, 2026
b31ba79
update docs
mduncans Apr 20, 2026
ea9bec6
update for sim fix
mduncans Apr 21, 2026
44d7855
update sim-fix
mduncans Apr 21, 2026
6164afe
update sim-fix
mduncans Apr 22, 2026
bc4b06e
update sim-record
mduncans Apr 22, 2026
ecb8fd8
update pharos
mduncans Apr 22, 2026
745364d
update pharos
mduncans Apr 22, 2026
c35d905
update grd names + snapshot fixes
mduncans Apr 23, 2026
937c43a
fix read_ext_file syntactic names
mduncans Apr 23, 2026
701de12
update pharos and fix metadata clear
mduncans Apr 27, 2026
9829259
cleanup
mduncans Apr 30, 2026
b281545
cleanup
mduncans May 1, 2026
8bc451f
fix omega raw_names + names. clean up vignettes dir
mduncans May 6, 2026
9038898
update vignettes add tags to copy
mduncans May 6, 2026
dbbe90a
update with pharos and config dir option. lineage rework updated
mduncans May 11, 2026
5cd10d7
cleanup tests and pharos.tomls with option
mduncans May 11, 2026
8acdb4d
add model_file to summary
mduncans May 12, 2026
13f2e18
update use_comments. touch up vignettes
mduncans May 13, 2026
faa20e9
update for pharos resolve ext
mduncans May 13, 2026
2e4c3ea
Update lineage print out. fix NAMESPACE and roxygen
mduncans May 14, 2026
266e926
update DESCRIPTION and pharos tag
mduncans May 14, 2026
d4f6718
Merge branch 'main' into nmparser
mduncans May 14, 2026
a96bade
update dep check to work with tags
mduncans May 14, 2026
4c0e0b8
cleanup ParsedXComment -> XCommentInfo conversioon
mduncans May 15, 2026
2c08e31
merge conflict spacing fix
mduncans May 15, 2026
6c7a10b
remove robj_to_model
mduncans May 15, 2026
f185bb8
fix run status
mduncans May 15, 2026
3addc9b
update read_ext_file
mduncans May 15, 2026
8981479
check vers
mduncans May 15, 2026
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
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@
^doc$
^Meta$
^_starlightr\.toml$
^\.positai$
18 changes: 16 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,25 @@ jobs:
run: |
git config --global url."https://${{ secrets.PRIVATE_REPO_ACCESS_TOKEN }}@github.com/".insteadOf "https://github.com/"

- uses: dtolnay/rust-toolchain@master
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.config.rust-version }}
targets: ${{ matrix.config.rust-target }}

- name: Ensure rustup cargo bin is first on PATH
if: runner.os != 'Windows'
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH

- name: Verify Rust toolchain
if: runner.os != 'Windows'
run: |
which rustup
which rustc
which cargo
rustup show
rustc --version
cargo --version

# Add rust-cache for faster builds
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -95,7 +109,7 @@ jobs:
echo "All system dependencies are present"
fi
- name: rv-sync
run: rv sync
run: rv sync -vvv
if: runner.os != 'Windows'

- name: rv-sync (Windows)
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/pharos-dependency-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@ jobs:

- name: Check pharos dependency status
run: |
# Get pharos branch from Cargo.toml
# Determine whether Cargo.toml pins pharos via branch or tag.
# Branch pin: compare lock commit to that branch's HEAD.
# Tag pin: compare lock commit to main's HEAD (so we still get
# notified when pharos advances past a release pin).
BRANCH=$(grep -A 2 'git = "https://github.com/a2-ai/pharos"' src/rust/Cargo.toml | grep 'branch =' | sed 's/.*branch = "\([^"]*\)".*/\1/' | head -1)
TAG=$(grep -A 2 'git = "https://github.com/a2-ai/pharos"' src/rust/Cargo.toml | grep 'tag =' | sed 's/.*tag = "\([^"]*\)".*/\1/' | head -1)

# Get current and latest commits
CURRENT=$(grep -A 1 'source = "git+https://github.com/a2-ai/pharos' src/rust/Cargo.lock | grep -o '#[a-f0-9]\{40\}' | head -1 | cut -c2-)
LATEST=$(git ls-remote https://github.com/a2-ai/pharos refs/heads/$BRANCH | cut -f1)

echo "Branch: $BRANCH"
if [ -n "$BRANCH" ]; then
TARGET_REF="refs/heads/$BRANCH"
TARGET_LABEL="branch $BRANCH"
elif [ -n "$TAG" ]; then
TARGET_REF="refs/heads/main"
TARGET_LABEL="main (pinned to tag $TAG)"
else
echo "::error::Could not determine pharos pin style (branch or tag) in Cargo.toml"
exit 1
fi

LATEST=$(git ls-remote https://github.com/a2-ai/pharos $TARGET_REF | cut -f1)

echo "Pin: $TARGET_LABEL"
echo "Current: $CURRENT"
echo "Latest: $LATEST"

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ lefthook.yaml
./pharos.toml
/doc/
/Meta/
.positai
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: hyperion
Title: Pharmaceutical Model Development and Workflow Tools
Version: 0.4.2
Version: 0.5.0
Authors@R: c(
person("Matt", "Smith", , "matthews@a2-ai.com", role = c("aut", "cre")),
person("Vincent", "Prouillet", ,"vincent@a2-ai.com", role = c("aut")),
Expand All @@ -17,8 +17,7 @@ Description: Hyperion is an R interface to the pharos CLI for
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Config/rextendr/version: 0.4.2
Config/rextendr/version: 0.5.0
Config/build/never-clean: true
Config/build/extra-sources: src/rust/Cargo.lock
SystemRequirements: Cargo (Rust's package manager), rustc >= 1.65.0, xz
Expand All @@ -33,7 +32,6 @@ Suggests:
withr
VignetteBuilder: knitr
Imports:
fs,
cli,
knitr,
lifecycle,
Expand All @@ -42,3 +40,5 @@ Imports:
tomledit
Config/testthat/edition: 3
URL: https://a2-ai.github.io/hyperion-docs, https://github.com/a2-ai/hyperion
Config/roxygen2/version: 7.3.3
RoxygenNote: 7.3.3
29 changes: 15 additions & 14 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Generated by roxygen2: do not edit by hand

S3method(base::`$`, hyperion_nonmem_model)
S3method(base::`[[`, hyperion_nonmem_model)
S3method(base::names, hyperion_nonmem_model)
S3method(base::print, hyperion_model_metadata)
S3method(base::print, hyperion_nonmem_dataset)
S3method(base::print, hyperion_nonmem_model)
S3method(base::print, hyperion_nonmem_summary)
S3method(base::print, hyperion_nonmem_summary_not_run)
S3method(base::print, hyperion_nonmem_summary_running)
S3method(base::print, hyperion_nonmem_tree)
S3method(base::print, parameter_audit)
S3method(base::summary, hyperion_nonmem_model)
S3method(base::`$`,hyperion_nonmem_model)
S3method(base::`[[`,hyperion_nonmem_model)
S3method(base::names,hyperion_nonmem_model)
S3method(base::print,hyperion_model_metadata)
S3method(base::print,hyperion_nonmem_dataset)
S3method(base::print,hyperion_nonmem_model)
S3method(base::print,hyperion_nonmem_summary)
S3method(base::print,hyperion_nonmem_summary_not_run)
S3method(base::print,hyperion_nonmem_summary_running)
S3method(base::print,hyperion_nonmem_tree)
S3method(base::print,parameter_audit)
S3method(base::summary,hyperion_nonmem_model)
S3method(knitr::knit_print,hyperion_model_metadata)
S3method(knitr::knit_print,hyperion_nonmem_dataset)
S3method(knitr::knit_print,hyperion_nonmem_model)
Expand All @@ -20,7 +20,7 @@ S3method(knitr::knit_print,hyperion_nonmem_summary_not_run)
S3method(knitr::knit_print,hyperion_nonmem_summary_running)
S3method(knitr::knit_print,hyperion_nonmem_tree)
S3method(knitr::knit_print,parameter_audit)
S3method(utils::str, hyperion_nonmem_model)
S3method(utils::str,hyperion_nonmem_model)
export(ModelComments)
export(OmegaComment)
export(SigmaComment)
Expand All @@ -32,13 +32,13 @@ export(are_models_in_lineage)
export(audit_parameter_info)
export(check_dataset)
export(check_model)
export(clear_metadata_file)
export(compute_ci)
export(compute_cv)
export(compute_rse)
export(copy_model)
export(format_hyperion_decimal_string)
export(format_hyperion_sigfig_string)
export(format_omega_display_name)
export(from_config_relative)
export(get_comment)
export(get_comment_type)
Expand Down Expand Up @@ -74,6 +74,7 @@ export(submit_model_to_slurm)
export(transform_value)
export(update_metadata_file)
export(update_param_info)
export(use_comments)
export(use_type1_comments)
if (getRversion() < "4.3.0") importFrom("S7", "@")
importFrom(knitr,knit_print)
Expand Down
63 changes: 63 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,66 @@
# hyperion 0.5.0

## Breaking changes

- `get_model_lineage()` signature changed. Old: `get_model_lineage(model_dir)`
(required a directory or model object). New: `get_model_lineage(model = NULL,
from = NULL, to = NULL)`.
- No-arg call returns the whole project lineage tree, rooted at the directory
containing `pharos.toml`.
- `model` returns ancestors and descendants of one model.
- `from`/`to` filter the tree downstream / upstream / to the slice between
two models.
- The `model_dir` argument no longer exists.
- `copy_model()` `description` is now required (was `description = NULL`).
- R-side raw comment parsing is removed. All comment parsing is owned by
pharos. The "raw" mode documentation, parsing pipeline, and transform
keyword mapping are gone from `get_model_parameter_info()`. `NA` names are
acceptable when pharos cannot parse a comment; `summary()` falls back to
NONMEM names in that case. Raw parsing mode is most similar to `type2`
comments in pharos.
- `use_type1_comments()` is soft-deprecated in favor of `use_comments()`.
It still works but emits a `.Deprecated()` warning and delegates.

## New features

- `clear_metadata_file()` — new exported function. Selectively clears
`based_on`, `copied_from`, and/or `tags` in a model's metadata file;
unspecified fields are preserved.
- `copy_model()` gains `based_on` and `tags` arguments so metadata can be
populated at copy time rather than via a follow-up `set_metadata_file()`.
- `set_metadata_file()` gains `copied_from` to record mechanical-copy
provenance separately from `based_on`.
- `hyperion.config_dir` option — explicit override for where `pharos.toml` is
resolved from. Status is surfaced in the package-load options message.
- `use_comments(type = c("type1", "type2"))` — single entry point for setting
comment parsing type in `pharos.toml`. The new `"type2"` mode is a flexible
structured grammar; `"type1"` remains strict structured. Replaces
`use_type1_comments()`.
- `summary()` includes `model_file` in its output.
- `read_ext_file()` accepts a `hyperion_nonmem_model` object in addition to
the previously-supported path forms.
- `get_model_lineage(verbose = TRUE)` renders the lineage as a flat table
with Model, Parent, Description, Tags, Model Hash, and Dataset Hash columns
instead of the tree view.

## Bug fixes

- `.ext` parameter columns are sanitized to syntactic R names (e.g.
`IIV (CL)` → `IIV_CL`), so returned data frames no longer require backtick
quoting.
- `.grd` gradient column names are similarly sanitized; the surrounding
`GRD(...)` wrapper is stripped before sanitization.
- Fixed `clear_metadata_file()` so previously-set values are actually cleared
(prior behavior left stale fields in place).
- `read_model()` reports parsing diagnostics for malformed NONMEM control
streams, backed by a new pharos parser aimed at better control-stream
coverage.
- `$EST FILE=` overrides are now honored when locating `.ext` files in
`get_parameters()`, `read_ext_file()`, `get_run_status()`, and
`copy_model()` parameter updates. Previously these always used
`{model}.ext` regardless of where NONMEM was actually writing estimates.


# hyperion 0.4.2

## Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion R/comments-audit.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ audit_parameter_info <- function(info) {
#' @param x A parameter_audit object
#' @param ... Additional arguments (ignored)
#' @return Invisible copy of x
#' @rawNamespace S3method(base::print, parameter_audit)
#' @exportS3Method base::print parameter_audit
print.parameter_audit <- function(x, ...) {
cli::cli_text("")
cli::cli_h1("Parameter Info Audit")
Expand Down
Loading
Loading