The reverse of process_from_spec(): slot tables become row lists
(all-NA columns and empty tables are omitted; NA dimension values are
omitted from rows, i.e. read back as "applies to ALL").
See also
Other process spec:
process_from_spec(),
process_spec_code(),
process_spec_issues(),
read_process_spec()
Examples
tech <- topia$modules$electricity$R3$ECOA
# the object as a plain nested list: diffable, editable, writable as YAML
spec <- process_to_spec(tech)
names(spec)
#> [1] "techspec" "class" "name"
#> [4] "desc" "cap2act" "optimizeRetirement"
#> [7] "inputs" "outputs" "efficiency"
#> [10] "invcost" "fixom" "vintages"
#> [13] "capacity"
spec$efficiency
#> [[1]]
#> [[1]]$comm
#> [1] "COA"
#>
#> [[1]]$cinp2use
#> [1] 0.4
#>
#>
# `process_from_spec()` is the way back
identical(process_from_spec(spec)@name, tech@name)
#> [1] TRUE
