Transforms a function into one that injects values in place of sown ones.
oryx.core.plant(
f,
*,
tag: Hashable,
allowlist: Optional[Iterable[str]] = None,
blocklist: Iterable[str] = frozenset(),
exclusive: bool = False
)
Args |
f
|
a function to be transformed.
|
tag
|
a string tag; only sown values with tag will be planted.
|
allowlist
|
an optional sequence of string names, which if provided will
enforce that only sows with names in the allowlist will be planted.
|
blocklist
|
an optional sequence of string names, which if provided will
enforce that only no sows with names in the blocklist will be planted.
|
exclusive
|
determines whether or not to execute in "exclusive" mode where
other tags are removed during execution.
|
Returns |
A new function that takes in a dictionary of planted values in addition to
the original function's inputs, and injects the planted values in place of
sown values.
|