From 9f1c4f356f0f89970bc9d936e297d02202d16727 Mon Sep 17 00:00:00 2001 From: dkapraun Date: Wed, 21 Jan 2026 16:43:13 -0500 Subject: [PATCH 1/2] Fixed issue involving spaces in path names in the file 'fixPath.R', updated docstrings in 'MCSim_model.R', and updated version number in 'DESCRIPTION'. --- DESCRIPTION | 2 +- R/MCSim_model.R | 4 ++-- R/fixPath.R | 5 ++++- man/Model-class.Rd | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6133daa..4243532 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: MCSimMod Title: Working with 'MCSim' Models -Version: 1.1.9000 +Version: 1.2 Authors@R: c( person("Dustin F.", "Kapraun", role=c("aut", "cre"), email = "kapraun.dustin@epa.gov", comment = c(ORCID = "0000-0001-5570-6383")), person("Todd J.", "Zurlinden", role="aut", comment = c(ORCID = "0000-0003-1372-3913")), diff --git a/R/MCSim_model.R b/R/MCSim_model.R index 8b6a01f..7d4ec50 100644 --- a/R/MCSim_model.R +++ b/R/MCSim_model.R @@ -149,11 +149,11 @@ Model <- setRefClass("Model", Y0 <<- initStates(parms) }, updateParms = function(new_parms = NULL) { - "Update values of parameters for the Model object." + "Reset the values of the parameters for the Model object to their default values and then update the values of any parameters named in the argument `new_parms` using values provided in that argument." parms <<- initParms(new_parms) }, updateY0 = function(new_states = NULL) { - "Update values of initial conditions of state variables for the Model object." + "Reset the values of the initial conditions of state variables for the Model object to their default values and then update the values of the initial conditions of any state variables named in the argument `new_states` using values provided in that argument." Y0 <<- initStates(parms, new_states) }, runModel = function(times, ...) { diff --git a/R/fixPath.R b/R/fixPath.R index d7a5b47..98d109f 100644 --- a/R/fixPath.R +++ b/R/fixPath.R @@ -2,11 +2,14 @@ # fixPath #---------------- # Private function to create platform-dependent mPath and mName -# based on absolute path generate by normalizePath +# based on absolute path generated by normalizePath .fixPath <- function(file) { new.mName <- strsplit(basename(file), "[.]")[[1]][1] new.mPath <- dirname(file) + if (.Platform$OS.type == "windows") { + new.mPath <- gsub("\\\\", "/", utils::shortPathName(new.mPath)) + } has_space <- grepl(" ", new.mPath) if (has_space == T) { diff --git a/man/Model-class.Rd b/man/Model-class.Rd index cb31ee2..091f95e 100644 --- a/man/Model-class.Rd +++ b/man/Model-class.Rd @@ -65,8 +65,8 @@ expression \code{mod$updateParms()}. Use the \code{createModel()} function to cr \item{\code{runModel(times, ...)}}{Perform a simulation for the Model object using the \code{deSolve} function \code{ode} for the specified \code{times}.} -\item{\code{updateParms(new_parms = NULL)}}{Update values of parameters for the Model object.} +\item{\code{updateParms(new_parms = NULL)}}{Reset the values of the parameters for the Model object to their default values and then update the values of any parameters named in the argument `new_parms` using values provided in that argument.} -\item{\code{updateY0(new_states = NULL)}}{Update values of initial conditions of state variables for the Model object.} +\item{\code{updateY0(new_states = NULL)}}{Reset the values of the initial conditions of state variables for the Model object to their default values and then update the values of the initial conditions of any state variables named in the argument `new_states` using values provided in that argument.} }} From 9abb8249c2c24a3a29c05131ccb81c04c0ccd99e Mon Sep 17 00:00:00 2001 From: Dustin Kapraun <63881572+dfkapraun@users.noreply.github.com> Date: Thu, 22 Jan 2026 14:35:49 -0500 Subject: [PATCH 2/2] Update R/fixPath.R Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- R/fixPath.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/fixPath.R b/R/fixPath.R index 98d109f..83b09d7 100644 --- a/R/fixPath.R +++ b/R/fixPath.R @@ -12,7 +12,7 @@ } has_space <- grepl(" ", new.mPath) - if (has_space == T) { + if (has_space == TRUE) { stop("Error: User-defined directory has space which will throw error for .dll/.so compilation") }