Skip to content
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

Fix the Replace grammar to accept ETA(#) on rhs #189

Merged
merged 4 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: nonmem2rx
Type: Package
Title: Converts 'NONMEM' Models to 'rxode2'
Version: 0.1.5
Version: 0.1.5.9000
Maintainer: Matthew Fidler <[email protected]>
Authors@R: c(person("Matthew","Fidler", role = c("aut", "cre"), email = "[email protected]", comment=c(ORCID="0000-0001-8538-6691")),
person("Philip", "Delff", email = "[email protected]",role = c("ctb")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# nonmem2rx (development version)

* Add more flexible replacement of ETA and other values #188

* Add ability to use `nonmem2rx` with a NONMEM control stream text input

# nonmem2rx 0.1.5

* Be more forgiving in the validation and remove IDs without
Expand Down
6 changes: 6 additions & 0 deletions R/nonmem2rx.R
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,12 @@ nonmem2rx <- function(file, inputData=NULL, nonmemOutputDir=NULL,
load=getOption("nonmem2rx.load", TRUE),
compress=getOption("nonmem2rx.compress", TRUE),
keep=getOption("nonmem2rx.keep", c("dfSub", "dfObs", "thetaMat", "sigma"))) {
if (any(grepl("[$][Pp][Rr][Oo][Bb][Ll][Ee][Mm]", file))) {
.file <- tempfile(fileext=".ctl")
writeLines(gsub("[ \t]+[$]", "$", file), .file)
file <- .file
on.exit(unlink(.file))
}
.pt <- proc.time()
.ret <- .collectWarn({
checkmate::assertFileExists(file)
Expand Down
3 changes: 1 addition & 2 deletions inst/abbrec.g
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ seq_nm: decimalint (':' | 'TO' | 'to' | 'To') decimalint
seq_arg: '(' ','* (seq_nm | decimalint) (',' (seq_nm | decimalint))* ')';

replace_direct1: var_replace '(' identifier_nm ')' '=' var_replace '(' decimalintNo0 ')';
replace_direct2: identifier_nm '=' (identifier_nm | constantneg);
replace_direct2: identifier_nm '=' (identifier_nm | constantneg | var_replace '(' decimalintNo0 ')');
replace_direct3: identifier_nm '=' string;

replace_data: var_rep2 '(' identifier_nm ')' '=' var_rep2 (seq_arg | dec_arg);
Expand All @@ -70,4 +70,3 @@ decimalintNo0: "([1-9][0-9]*)" $term -1;
decimalint: "0|([1-9][0-9]*)" $term -1;
float1: "([0-9]+.[0-9]*|[0-9]*.[0-9]+)([eE][\-\+]?[0-9]+)?" $term -2;
float2: "[0-9]+[eE][\-\+]?[0-9]+" $term -3;

Loading
Loading