flowrep.compiler.sugar module
- flowrep.compiler.sugar.attribute_name(label: str, recipe: WorkflowRecipe) str | None[source]
The identifier fed to label’s
nameport by a constant peer, else None.
- flowrep.compiler.sugar.is_attribute_syntax(value: Any) bool[source]
True if value can be written after a
.in Python source.Deliberately laxer than
base_models.is_valid_label(), which also excludes the reserved port namesinputs/outputs. Those are perfectly legal attributes, anddc.inputsmust compile back todc.inputs.
- flowrep.compiler.sugar.is_std_getattr(node: Annotated[AtomicRecipe | ConstantRecipe | ForEachRecipe | IfRecipe | TryRecipe | WhileRecipe | WorkflowRecipe, FieldInfo(annotation=NoneType, required=True, discriminator='type')]) bool[source]
True if node is the standard-library attribute-access recipe.
Matched on the referenced function’s fully qualified name rather than on
VersionInfoequality, so a recipe serialised under a different flowrep version is still recognised.
- flowrep.compiler.sugar.is_std_getitem(node: Annotated[AtomicRecipe | ConstantRecipe | ForEachRecipe | IfRecipe | TryRecipe | WhileRecipe | WorkflowRecipe, FieldInfo(annotation=NoneType, required=True, discriminator='type')]) bool[source]
True if node is the standard-library item-access recipe.
Matched on the referenced function’s fully qualified name rather than on
VersionInfoequality, so a recipe serialised under a different flowrep version is still recognised.