Skip to content

Commit

Permalink
Merge pull request #589 from nlmixr2/588-matexp-fortran
Browse files Browse the repository at this point in the history
588 matexp fortran
  • Loading branch information
mattfidler authored Oct 8, 2023
2 parents cc50f86 + 297561f commit cbb2704
Show file tree
Hide file tree
Showing 14 changed files with 116 additions and 110 deletions.
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: rxode2
Version: 2.0.13.9000
Version: 2.0.14.9000
Title: Facilities for Simulating from ODE-Based Models
Authors@R: c(
person("Matthew L.","Fidler",
role = c("aut", "cre"), email = "matthew.fidler@gmail.com",
comment=c(ORCID="0000-0001-8538-6691")),
person("Melissa", "Hallow",
role = "aut", email = "hallowkm@uga.edu"),
person("Wenping", "Wang",
person("Wenping", "Wang",
role = c("aut"), email = "wwang8198@gmail.com"),
person("Zufar", "Mulyukov", role="ctb", email="zufar.mulyukov@novartis.com"),
person("Alan", "Hindmarsh",role="ctb"),
Expand Down Expand Up @@ -77,7 +77,7 @@ Imports:
backports,
cli (>= 2.0.0),
checkmate,
ggplot2,
ggplot2 (>= 3.4.0),
inline,
lotri (>= 0.4.0),
magrittr,
Expand All @@ -104,16 +104,16 @@ Description: Facilities for running simulations from ordinary
Section 6.3, Appendix A, and Appendix D in the "R Administration and
Installation" manual. Also the code is mostly released under GPL. The
'VODE' and 'LSODA' are in the public domain. The information is available
in the inst/COPYRIGHTS.
in the inst/COPYRIGHTS.
BugReports: https://github.com/nlmixr2/rxode2/issues/
NeedsCompilation: yes
VignetteBuilder: knitr
License: GPL (>= 3)
License: GPL (>= 3)
URL: https://nlmixr2.github.io/rxode2/,
https://github.com/nlmixr2/rxode2/
RoxygenNote: 7.2.3
Biarch: true
LinkingTo:
LinkingTo:
rxode2parse (>= 2.0.12),
rxode2random,
PreciseSums (>= 0.3),
Expand Down
11 changes: 10 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,16 @@ mu-referencing style to run the optimization.
- Bug fix for some covariate updates that may affect multiple compartment
models (like issue #581)

# rxode2 2.0.13
# rxode2 2.1.14

- CRAN requested that FORTRAN `kind` be changed as it was not portable;
This was commented code, and simply removed the comment.

- Bug-fix for `geom_amt()`; also now uses `linewidth` and at least `ggplot2 3.4.0`

- Some documentation was cleaned up from `rxode2` 2.1.13

# rxode2 2.1.13

## Bug fixes

Expand Down
8 changes: 4 additions & 4 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ etTrans <- function(inData, obj, addCmt = FALSE, dropUnits = FALSE, allTimeVar =
#' @param c1 character vector of items to be expanded
#' @param c2 second character vector of items to be expanded
#' @param type 0 for a typical data frame, 1 for symengine sensitivity expansion
#' @return data frame (when type = 0) or symengine string (when type=1)
#' @return data frame (when type = 0) or symengine string (when type=1)
#' @export
#' @keywords internal
rxExpandGrid_ <- function(c1, c2, type) {
Expand Down Expand Up @@ -74,7 +74,7 @@ rxExpandSens2_ <- function(state, s1, s2) {
#'
#' @param state is the state to expand
#' @param neta is the number of etas
#' @param pred type of prediction
#' @param pred type of prediction
#' @keywords internal
#' @return String of symengine expressions to evaluate to calculate df/deta
#' @export
Expand All @@ -84,7 +84,7 @@ rxExpandFEta_ <- function(state, neta, pred) {

#' Rep R0 for foce
#'
#' @param number ETA to substitute
#' @param neta ETA to substitute
#'
#' @return Returns a string of R code to substitute the rx_r expression in the symengine environment .s
#'
Expand Down Expand Up @@ -260,7 +260,7 @@ rxSetupIni <- function(obj, inits = NULL) {
#'
#' @param obj rxode2 object
#'
#' @param inits A numeric vector of initial conditions.
#' @param scale A numeric vector scales
#'
#' @param extraArgs A list of extra args to parse for initial conditions.
#'
Expand Down
23 changes: 11 additions & 12 deletions R/err.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"f"=2:3,
"dgeom"=1,
"geom"=1,
# "dhyper"=3,
# "hyper"=3,
# "dhyper"=3,
# "hyper"=3,
"dunif"=0:2,
"unif"=0:2,
"dweibull"=1:2,
Expand Down Expand Up @@ -233,7 +233,7 @@ rxPreferredDistributionName <- function(dist) {
}

.rxTransformHasBounds <- function(distribution) {
(as.integer(distribution) %in% 5:14)
(as.integer(distribution) %in% 5:14)
}

.rxAddPropLevels <- c(
Expand Down Expand Up @@ -336,7 +336,7 @@ rxDemoteAddErr <- function(errType) {

.incompatibleErr <- function(err1, err2) {
.errs <- sort(c(err1, err2))
paste0("`", .errs[1], "` and `", .errs[2], "` are incompatible")
paste0("`", .errs[1], "` and `", .errs[2], "` are incompatible")
}
#' Combine error types to get the model F type
#'
Expand Down Expand Up @@ -545,12 +545,11 @@ rxDemoteAddErr <- function(errType) {
#' `oldErrType` to zero assuming that there is no prior
#' distribution.
#'
#' @param newTransform This is the new distribution that is being
#' @param newErrType This is the new distribution that is being
#' "added" to the current transformation. These assumes the inputs
#' are in the preferred distribution name, as determined by
#' `rxPreferredDistributionName()`
#'
#'
#' @return The new transformation as a factor
#'
#' @author Matthew Fidler
Expand Down Expand Up @@ -598,7 +597,7 @@ rxErrTypeCombine <- function(oldErrType, newErrType) {
env$.numeric <- -(expression[[2]])
return(TRUE)
} else if (identical(expression[[1]], quote(`+`)) &&
is.numeric(expression[[2]])) {
is.numeric(expression[[2]])) {
env$.numeric <- expression[[2]]
return(TRUE)
}
Expand Down Expand Up @@ -627,7 +626,7 @@ rxErrTypeCombine <- function(oldErrType, newErrType) {
dexp=c("a"), #7
f=c("a", "b", "c"), #8
geom=c("a"), #9
# hyper=c("a", "b", "c"), #10
# hyper=c("a", "b", "c"), #10
unif=c("a", "b"), #11
weibull=c("a", "b"), #12
cauchy=c("a", "b"),
Expand Down Expand Up @@ -1183,7 +1182,7 @@ rxErrTypeCombine <- function(oldErrType, newErrType) {
setNames(
c("linCmtA" = 1L, "linCmtB" = 2L,
"linCmtC" = 3L
)[match.arg(linCmtSens)],
)[match.arg(linCmtSens)],
NULL
), verbose
))
Expand Down Expand Up @@ -1257,8 +1256,8 @@ rxErrTypeCombine <- function(oldErrType, newErrType) {
}
.mod <- eval(parse(text=paste0("quote({", .var, "=1+2\n", deparse1(expr), "})")))
.ini <- as.data.frame(eval(parse(text=paste0("lotri({\n",
paste(paste(allNames(expr[[3]]), "<- 1"), collapse="\n"),
"\n})"))))
paste(paste(allNames(expr[[3]]), "<- 1"), collapse="\n"),
"\n})"))))
.env <- try(.errProcessExpression(.mod, .ini, checkMissing=FALSE), silent=TRUE)
if (inherits(.env, "try-error")) return(FALSE)
if (uiEnv) return(.env)
Expand All @@ -1267,7 +1266,7 @@ rxErrTypeCombine <- function(oldErrType, newErrType) {
#' Is Normal, Cauchy or t distribution model specification?
#'
#' @param expr Expression
#'
#'
#' @return TRUE if this is a normal/t/cauchy model, FALSE otherwise
#' @author Matthew L. Fidler
#' @noRd
Expand Down
2 changes: 1 addition & 1 deletion R/genShinyApp.template.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#' dosing regimen simulation web application. Users may want to
#' modify the code to experiment creating shiny applications for
#' their specific `rxode2` models.
#' @seealso [rxode2()],[eventTable()], and the package \pkg{shiny} (<https://shiny.rstudio.com>).
#' @seealso [rxode2()],[eventTable()], and the package \pkg{shiny} (<https://shiny.posit.co>).
#'
#' @examples
#' \donttest{
Expand Down
5 changes: 2 additions & 3 deletions R/geom-amt.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
stop("need 'amt' aesthetic")
} else if (!any(names(data) == "x") && any(names(data) == "time")) {
data$x <- data$time
} else if (any(names(data) == "x")) {
} else {
} else if (!any(names(data) == "x")) {
stop("need 'x' aesthetic")
}
ret <- data[!is.na(data$amt), c("x", "amt")]
Expand Down Expand Up @@ -88,7 +87,7 @@ StatAmt <- ggplot2::ggproto("StatAmt", ggplot2::Stat,
#' # of course you can make it a bit more visible
#'
#' plot(bidQd, C2) + geom_amt(aes(amt=amt), col="red", lty=1, linewidth=1.2)
#'
#'
#' }
#' @export
#' @inheritParams ggplot2::stat_identity
Expand Down
2 changes: 1 addition & 1 deletion man/genShinyApp.template.Rd

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

2 changes: 1 addition & 1 deletion man/rxErrTypeCombine.Rd

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

2 changes: 1 addition & 1 deletion man/rxRepR0_.Rd

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

4 changes: 2 additions & 2 deletions man/rxSetupScale.Rd

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

4 changes: 2 additions & 2 deletions man/rxode2.Rd

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

Loading

0 comments on commit cbb2704

Please sign in to comment.