nv_dfm_core.api: Pipeline API#

The API package contains all the pydantic models that encode the available functions that can be sent to the dfm for execution.

Core#

The building blocks for constructing DFM pipelines.

Pipeline

Represents a DFM pipeline containing a sequence of operations and control flow.

PreparedPipeline

A pipeline that has been prepared and optimized for execution in a federation.

Operation

An Operation is semantically similar to a remote method call on the containing provider object.

Yield

Sends a value back to a place located in the app.

PlaceParam

This marker is attached to Statements to indicate that the value is passed later as a pipeline a parameter.

NodeRef

A NodeRef is used to identify (reference) a node in a pipeline when passing the output of a node as a parameter to another node.

Control Flow#

Constructs for branching, looping, and caching within a pipeline.

ForEach

Takes an iterable and iterates over it, executing the body for each element.

If

IfTrue is a statement that executes the body if the condition is true.

Block

A Block is a linear list of Statements (and subclasses of Statements).

TryFromCache

Takes a key and tries to get the value from the cache.

WriteToCache

Writes a value to the cache.

BestOf

This marker is attached to site and provider to indicate that the user wants IRGen to deduce the optimal location.

Advise

This marker is attached to statements to request advice for fields

Boolean Expressions#

Used with If to define conditional logic.

BooleanExpression

Represent a PEP 604 union type

ComparisonExpression

Represent a PEP 604 union type

And

Represents a logical AND operation.

Or

Represents a logical OR operation.

Not

Represents a logical NOT operation.

Equal

Represents an equality comparison (==).

NotEqual

Represents a not equal comparison (!=).

GreaterThan

Represents a greater than comparison (>).

GreaterThanOrEqual

Represents a greater than or equal comparison (>=).

LessThan

Represents a less than comparison (<).

LessThanOrEqual

Represents a less than or equal comparison (<=).

Atom

Represent a PEP 604 union type

Tokens and Signals#

Internal data units that flow through the pipeline.

StopToken

A token indicating that a pipeline stream has been stopped.

ErrorToken

A token representing one or more errors that occurred during pipeline execution.

Advanced#

Lower-level types and utilities for framework authors and advanced users.

PipelineBuildHelper

The PipelineBuildHelper is a helper for the user to simplify writing DFM code that is embedded inside python.

NodeId

NodeId uniquely identifies a node in a Pipeline graph.

NodeParam

Represent a PEP 604 union type

Located

Located is a mixin class for statements that are assigned to a specific site.

Expression

An expression is a Statement that produces a value that can be referenced by other Statements.

Statement

A Statement is the base class for all syntactic constructs that can appear in a Pipeline body.

PickledObject

A class that can serialize and deserialize a Python object to a JSON string by pickling and base64 encoding it.

ApiVisitor

Base visitor class for traversing DFM API models.

BooleanExpressionVisitor

Visitor interface for boolean expressions.

make_auto_id

Auto IDs are prefixed with %.

well_known_id

Well-known IDs (user-defined IDs) are prefixed with #.