Register a node kind in the bayesgrove runtime registry
Source:R/registry.R
bg_register_node_kind.RdNode kinds have a structural component (stored in the graph) and a runtime component (the executor, stored in the handle).
Usage
bg_register_node_kind(
project,
kind,
input_contract = NULL,
output_type = NULL,
param_schema = NULL,
executor = NULL,
pad = NULL
)Arguments
- project
A
bg_handle.- kind
The name of the node kind.
- input_contract
Optional input contract for the structural graph.
- output_type
Optional output type string.
- param_schema
Optional parameter schema.
- executor
Optional R function to execute nodes of this kind. It is called as
executor(node, inputs), whereinputsis a list of upstream artifacts named by node id. It may return the artifact itself, or an envelopelist(result = , summaries = , metadata = ). Withoutsummaries, a list is treated as an envelope only when it has exactly one ofresultorartifact, hasmetadata, and has no other entries; any other list is stored as the artifact. Ametadata$provenance = list(consumed = , effective = )entry reports what the execution consumed (consumed$D, the data input ids it used;consumed$subject, the input id of the fit a check evaluated;consumed$data_files,list(node_id, path)entries naming file-path inputs it read) and the settings it actually used (effective$P,effective$A). Without a report, every input counts as consumed data. For kinds that declarepad, file-backed data is supported only as a non-empty regular file hashed before the run at the identical path, resolved in the executing process: every consumedDinput whose value is a character string must be such a file (empty files, devices, FIFOs, and other special files are unsupported and never opened), everydata_filesentry must name a consumedDinput at that path, thestan_filesource and its includes must exist, and none of these may change during execution. Otherwise the provenance records acapture_errorand no P/A/D snapshot; inputs that were not consumed are never checked.- pad
Optional P/A/D classification of the kind's parameters: a named list with character vectors
P(model),A(algorithm),D(data),locator(parameters that select inputs, such asdata_input), andother(parameters that don't change the result's meaning, such as diagnostic thresholds). Each parameter may appear in one category only. When a node's parameters are all classified, each execution records a P/A/D snapshot with SHA-256 digests in its provenance (seebg_node_pad()); an unclassified parameter means no snapshot is recorded. The declaration is stored in the runtime manifest and restored bybg_open(). If provenance cannot be captured at all, the succeeded job recordscapture_errorinstead ofprovenance.