save_job() writes a JSON manifest for an EplusJob, EplusGroupJob, or ParametricJob. read_job() reads that manifest, validates its structure, verifies saved output file metadata, and restores the job object so existing simulation outputs can be collected.

save_job(x, path = NULL, overwrite = FALSE, relative = TRUE, hash = TRUE)

read_job(path, validate = TRUE, verify = c("warn", "error", "ignore"))

Arguments

x

An EplusJob, EplusGroupJob, or ParametricJob.

path

A JSON file path. If NULL, a default file name is used in the input model directory.

overwrite

Whether an existing manifest, and any generated ParametricJob model snapshots, may be overwritten.

relative

Whether paths under the manifest directory should be written as relative paths.

hash

Whether to hash existing EnergyPlus result files. File size and modification time are still recorded when FALSE.

validate

Whether to validate the JSON manifest against eplusr's job manifest schema before restoring the object.

verify

How to handle saved EnergyPlus result files whose current checksum or metadata no longer match the manifest. "warn" restores the job and emits a warning, "error" stops, and "ignore" skips the check.

Value

save_job() invisibly returns the manifest path. read_job() returns an EplusJob, EplusGroupJob, or ParametricJob.

Details

The JSON manifest stores references to input and output files instead of embedding EnergyPlus files. By default, paths under the manifest directory are stored relative to the manifest so the directory can be moved together. EnergyPlus result files are also recorded with file size, modification time, and a checksum when available. These file metadata are informational and do not prevent read_job() from restoring the job object if files have been removed.

Model snapshots

The manifest stores a prepared model snapshot store for EplusJob, EplusGroupJob, and ParametricJob. For ParametricJob, arbitrary R measure functions passed to $apply_measure() are not serialized; the restored job uses the generated model snapshots and stored case data.

Examples

if (FALSE) { # \dontrun{
job <- eplus_job(path_idf, path_epw)
job$run(echo = FALSE)

path <- save_job(job, tempfile(fileext = ".json"))
restored <- read_job(path)
restored$status()
} # }