Skip to content

Commit

Permalink
fix print method and add handling for .mod extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettk committed Feb 29, 2024
1 parent ed641fe commit 5c02bdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/print.R
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ print.bbi_nonmem_summary <- function(x, .digits = 3, .fixed = FALSE, .off_diag =

#' @describeIn print_bbi Prints the `NMTRAN` evaluation of a `bbi_model` model
#' @export
print.nmtran_process <- function(x){
print.nmtran_process <- function(x, ...){

is_valid_print <- function(.x) {
if (!is.null(.x)) {
Expand Down
6 changes: 6 additions & 0 deletions R/run-nmtran.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ get_data_path_from_ctl <- function(.mod){
# Get data record
data_rec <- nmrec::select_records(ctl, "data")[[1]]
data_path <- nmrec::get_record_option(data_rec, "filename")$value

# Handling for `.mod` extensions
if(grepl("(?i)mod", fs::path_ext(mod_path))){
data_path <- file.path("..", data_path)
}

data_path_norm <- fs::path_norm(file.path(mod_path, data_path))

if(!fs::file_exists(data_path_norm)){
Expand Down
2 changes: 1 addition & 1 deletion man/print_bbi.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5c02bdb

Please sign in to comment.