nv_dfm_core.api.PipelineBuildHelper#

class nv_dfm_core.api.PipelineBuildHelper[source]#

The PipelineBuildHelper is a helper for the user to simplify writing DFM code that is embedded inside python. Therefore, it is only providing syntactic sugar to the user’s code but functionality wise is not important.

We mainly want to avoid a user having to invent node ids for every node and to avoid the user having to manually append each statement to the surrounding block. We also want to enable users to use Python with contexts as code segments.

The PipelineBuildHelper provides static methods that the other dfm.api classes call to find the current surrounding block and pipeline and to add themselves to this block.

class BuilderScope(pipeline, next_id_counter=0, block_stack=<factory>)[source]#

Scope information for building a pipeline, including the pipeline being built and tracking of node IDs and blocks.

Parameters:
  • pipeline (Any)

  • next_id_counter (int)

  • block_stack (list[Any])

classmethod enter_pipeline(pipe)[source]#

Called by Pipeline’s __enter__

Parameters:

pipe (Any)

Return type:

None

classmethod exit_pipeline(pipe)[source]#

Called by Pipeline’s __exit__

Parameters:

pipe (Any)

Return type:

None

classmethod get_current_block()[source]#

Get the currently active block in the pipeline being built.

Return type:

Any

classmethod get_fresh_node_id()[source]#

Generate a fresh unique node ID for the current pipeline being built.

Return type:

NodeId

classmethod pop_block(block)[source]#

Pop a block from the current pipeline’s block stack after validation.

Parameters:

block (Any)

Return type:

None

classmethod push_block(block)[source]#

Push a new block onto the current pipeline’s block stack.

Parameters:

block (Any)

Return type:

None