Skip to content

Commit

Permalink
Update mlxtran and remove file if present
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Sep 18, 2024
1 parent bc93d09 commit e218c59
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions R/equation.R
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ mlxTxt <- function(file, retFile=FALSE) {
.m2 <- c("<MODEL>",
.lines)
lapply(.m2, .mlxtranParseItem)
.mlxEnv$parsedFile <- TRUE
if (retFile) return(file)
.ret <- .mlxtranFinalize(.mlxEnv$lst, equation=TRUE, update=FALSE)
attr(.ret, "dirn") <- .dirn
Expand Down
11 changes: 10 additions & 1 deletion R/mlxtran.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.mlxEnv$lst <- list(mlxtran="")
.mlxEnv$isDesc <- FALSE
.mlxEnv$desc <- ""
.mlxEnv$parsedFile <- FALSE
}

#' This parses a single line from something like readLines
Expand Down Expand Up @@ -107,7 +108,11 @@
}
}
if (!is.null(.ret$MODEL$LONGITUDINAL)) {
.ret$MODEL$LONGITUDINAL$LONGITUDINAL <- .longitudinal(.ret$MODEL$LONGITUDINAL$LONGITUDINAL)
.long <- .longitudinal(.ret$MODEL$LONGITUDINAL$LONGITUDINAL)
if (.mlxEnv$parsedFile) {
.long$file <- NULL
}
.ret$MODEL$LONGITUDINAL$LONGITUDINAL <- .long
if (!is.null(.ret$MODEL$LONGITUDINAL$DEFINITION)) {
.ld <- .longDef(.ret$MODEL$LONGITUDINAL$DEFINITION)
.monolix2rx$endpointPred <- .getMonolixPreds(.ld)
Expand Down Expand Up @@ -178,7 +183,11 @@
if (!is.null(.mlxEnv$lst$MODEL$LONGITUDINAL)) {
.long <- .longitudinal(.mlxEnv$lst$MODEL$LONGITUDINAL$LONGITUDINAL)
.file <- .long$file
.mlxEnv$parsedFile <- FALSE
mlxTxt(.long$file, retFile=TRUE)
if (.mlxEnv$parsedFile) {
.minfo(paste0("integrated model file '", .file ,"' into mlxtran object"))
}
}
.mlxtranFinalize(.mlxEnv$lst, equation=equation, update=update)
}
Expand Down

0 comments on commit e218c59

Please sign in to comment.