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

feat(run): add readeso param in Idf$run() and EplusJob$run() #592

Merged
merged 5 commits into from
Jul 16, 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
17 changes: 13 additions & 4 deletions R/idf.R
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,12 @@ Idf <- R6::R6Class(classname = "Idf",
#' standard output and error from EnergyPlus. Default: same as
#' `wait`.
#'
#' @param readvars If `TRUE`, the `ReadVarESO` post-processor will run
#' to generate CSV files from the ESO output. Since those CSV
#' files are never used when extracting simulation data in eplusr,
#' setting it to `FALSE` can speed up the simulation if there are
#' hundreds of output variables or meters. Default: `TRUE`.
#'
#' @return An [EplusJob] object of current simulation.
#'
#' @examples
Expand All @@ -2501,6 +2507,9 @@ Idf <- R6::R6Class(classname = "Idf",
#' # copy all external files into the directory run simulation
#' idf$run(epw, dir = tempdir(), copy_external = TRUE)
#'
#' # run simulation without generating CSV files from ESO output
#' idf$run(epw, dir = tempdir(), readvars = FALSE)
#'
#' # check for simulation errors
#' job$errors()
#'
Expand All @@ -2517,8 +2526,8 @@ Idf <- R6::R6Class(classname = "Idf",
#' job$report_data()
#' }
#'
run = function(weather, dir = NULL, wait = TRUE, force = FALSE, copy_external = FALSE, echo = wait)
idf_run(self, private, weather, dir, wait, force, copy_external = copy_external, echo),
run = function(weather, dir = NULL, wait = TRUE, force = FALSE, copy_external = FALSE, echo = wait, readvars = TRUE)
idf_run(self, private, weather, dir, wait, force, copy_external = copy_external, echo = echo, readvars = readvars),
# }}}

# last_job {{{
Expand Down Expand Up @@ -3344,7 +3353,7 @@ idf_save <- function(self, private, path = NULL, format = eplusr_option("save_fo
# }}}
# idf_run {{{
idf_run <- function(self, private, epw, dir = NULL, wait = TRUE,
force = FALSE, copy_external = FALSE, echo = wait) {
force = FALSE, copy_external = FALSE, echo = wait, readvars = TRUE) {
# check if the model is still running
old <- private$m_log$job
if (!inherits(old, "EplusJob")) {
Expand All @@ -3355,7 +3364,7 @@ idf_run <- function(self, private, epw, dir = NULL, wait = TRUE,
}

private$m_log$job$run(epw = epw, dir = dir, wait = wait, force = force,
echo = echo, copy_external = copy_external
echo = echo, copy_external = copy_external, readvars = readvars
)
}
# }}}
Expand Down
7 changes: 5 additions & 2 deletions R/job.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,13 @@ EplusJob <- R6::R6Class(classname = "EplusJob", cloneable = FALSE,
#'
#' # copy external files used in the model to simulation output directory
#' job$run(copy_external = TRUE)
#'
#' # run simulation without generating CSV files from ESO output
#' job$run(epw, dir = tempdir(), readvars = FALSE)
#' }
#'
run = function(epw, dir = NULL, wait = TRUE, force = FALSE, echo = wait, copy_external = FALSE)
job_run(self, private, epw, dir, wait, force, echo, copy_external),
run = function(epw, dir = NULL, wait = TRUE, force = FALSE, echo = wait, copy_external = FALSE, readvars = TRUE)
job_run(self, private, epw, dir, wait, force, echo, copy_external, readvars),
# }}}

# kill {{{
Expand Down
9 changes: 8 additions & 1 deletion man/EplusJob.Rd

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

15 changes: 14 additions & 1 deletion man/Idf.Rd

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

Loading