On this page |
Package-level functions
The following top-level attribute functions are designed to be used in Python expressions. You can use pdg.workItem()
to get the current work item object in a Python expression. The top-level function floatData(work_item, "foo", 0)
is equivalent to work_item.floatAttribValue("foo", 0)
, which is equivalent to the HScript expression @foo
.
Floats
floatData(work_item:
pdg.WorkItem, attribute_name: str, index: int = 0)
→ float
Returns the indexth float value under the attribute name on the given pdg.WorkItem object.
floatDataArray(work_item:
pdg.WorkItem, attribute_name: str)
→ List[str]
Returns the full list of float values under the attribute name on the given pdg.WorkItem object.
hasFloatData(work_item:
pdg.WorkItem, attribute_name: str)
→ bool
Returns True if the pdg.WorkItem object has a float attribute with the given name.
Integers
intData(work_item, attribute_name, index=0)
→ int
Same as floatData()
for integer attributes.
intDataArray(work_item, attribute_name)
→ list
of int
Same as floatDataArray()
for integer attributes.
hasIntData(work_item, attribute_name)
→ bool
Same as hasFloatData()
for integer attributes.
Strings
strData(work_item, attribute_name, index=0)
→ str
Same as floatData()
for string attributes.
strDataArray(work_item, attribute_name)
→ list
of str
Same as floatDataArray()
for string attributes.
hasStrData(work_item, attribute_name)
→ bool
Same as hasFloatData()
for string attributes.
Utilities
input(index=None, tag=None, localize=False)
→ list
or str
Returns the input files of the current work item.
This is intended to be used in Python expressions. The HScript expression equivalent is @pdg_input
.
The return type depends on the index
keyword argument. If index=None
, the function returns a list of input files. Otherwise, it returns the indexth input file path.
resultData(work_item, tag, localized=False, as_list=False)
→ list
or str
Returns output file(s) that have the given tag
on the pdg.WorkItem object.
If localized=True
then __PDG_DIR__
tokens in the path will be localized to the current machine.
The return type depends on the as_list
keyword argument. If as_list=False
, the function returns the file paths in a space-separated string. Otherwise it returns a list of path strings.
resultDataIndex(work_item:
pdg.WorkItem, tag: str, index: int, localized: bool=False)
→ str
Returns the indexth output file that has the given tag
on the pdg.WorkItem object.
If localized=True
then __PDG_DIR__
tokens in the path will be localized to the current machine.
hasResultData(work_item:
pdg.WorkItem, tag: str)
→ bool
Returns True
if the pdg.WorkItem has any output files with the given tag
.
Expression functions
workItem()
→ pdg.WorkItem
This is intended to be used in Python expressions. Returns the current work item object.
kwargs(key=None)
→ obj
or dict
This is intended to be used in Python expressions. Looks up a local variable from the expression evaluation context.
The return type depends on the key
keyword argument. If key=None
, the function returns all local variables as a dict
. Otherwise, it returns the value for the given key
.
API
attributes
-
A file array work item attribute.
-
An floating point array work item attribute.
-
An integer array work item attribute.
-
A utility for matching attribute names to a pattern.
-
A Python object work item attribute.
-
A string array work item attribute.
-
Base class for pdg.AttributePattern and pdg.ValuePattern.
-
A file object with a path and associated metadata
-
A utility for matching values or producing arrays of values
-
The enumeration of work item attribute flags
-
The enumeration of work item attribute overwrite options
-
The enumeration of work item attribute types
cooking
-
Container for cook options.
-
Container for graph evaluation options
-
The enumeration of possible cook modes
-
Enumeration of possible reasons for a node to regenerate during the cook
data
-
The enumeration of PDG data types
-
The type of work item generation being performed by generation callbacks
events
-
Represents an event that occurred while the graph was running.
-
Base class for objects that are able to emit events
-
Represents a handler function added to a node or graph.
-
The type of a pdg.Event
exceptions
-
Generic exception raised when an error occurs when accessing work item attributes
-
Generic exception raised when an error running the graph.
-
Generic exception raised when an error occurs during a PDG service manager operation
expressions
-
A module with global functions that operate on the thread-local evaluation context
internal
-
Memory info about a node and its work items
nodes
-
Represents an external dependency of a node.
-
Dependency graph processor node subclass for feedback loop begin blocks
-
Represents a node’s dependence on the existence of an external file.
-
Represents the dependency graph within the GraphContext object.
-
The top level object in a dependency graph.
-
Base class for dependency graph nodes.
-
Summary info used to configure a pdg.Node instance
-
An input, output or parameter on a PDG Node
-
Dependency graph node subclass representing a processor.
-
The subtype of PDG node type
-
The primary type of a PDG node
-
The type of a pdg.Port object
schedulers
-
A scheduler object that has its type implemented in Python.
-
Represents a scheduler in the dependency graph.
services
-
Object that represents a service
-
Object containing the registry of all PDG services
-
Indicates the owner of a PDG service
-
Indicates the state of a PDG service
types
-
Object containing registry of all custom node, work item, and scheduler types.
-
The enumeration of cache results that can be returned by a custom cache handler
-
The enumeration of possible dirty handler types
-
The enumeration of languages used to define custom PDG types
-
The type of object when registering a custom class with PDG
-
The return type of a node callback implementation
-
The return type of a scheduler’s onScheduler callback implementation
-
The return type of a onTick callback
-
The return type of a scheduler’s isWorkItemReady call
workitems
-
Represents a "batch" work item, which contains multiple child work items.
-
Container object for dependency pairs.
-
Keeps track of work items inside a partition.
-
A work item in the PDG graph.
-
Exposes methods to access work item data through Python
-
Container object for work items.
-
You can pass this object to WorkItemHolder.addWorkItem() to create a work item with the specified options.
-
The enumeration of batch activation conditions
-
The enumeration of clone modes that can be used when generating work items
-
Processing time statistics exposed by a PDG work item
-
The cook state of the work item
-
The type of the work item