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.
Arguments
- spec
Path to a
.yml/.yaml/.jsonfile, or a list as returned byyaml::read_yaml().
Value
The normalised spec list (invisibly validated; see
process_spec_issues() for the report).
See also
Other process spec:
process_from_spec(),
process_spec_code(),
process_spec_issues(),
process_to_spec()
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
