Skip to contents

Parses a spec file (or an already-parsed list) into the normalised list form used by process_from_spec() and the process designer. YAML (.yml/.yaml) and JSON (.json) are alternative containers for the same structure.

Usage

read_process_spec(spec)

Arguments

spec

Path to a .yml/.yaml/.json file, or a list as returned by yaml::read_yaml().

Value

The normalised spec list (invisibly validated; see process_spec_issues() for the report).

Examples

spec <- process_to_spec(topia$modules$electricity$R3$ECOA)

# a spec already in memory is returned as-is, so the same call accepts
# either a list or the path to a YAML file written by `process_to_spec()`
f <- tempfile(fileext = ".yml")
process_to_spec(topia$modules$electricity$R3$ECOA, file = f)
identical(read_process_spec(f)$name, spec$name)
#> [1] TRUE