Skip to main content

PortInfo / MethodSignature

C++: phynexis::workflow::PortInfo / phynexis::workflow::MethodSignature Python: phynexis.workflow.PortInfo / phynexis.workflow.MethodSignature Header: src/workflow/types.hpp

Description

PortInfo describes a single input or output port of a workflow method. MethodSignature aggregates multiple port descriptors with a method name and description to form a complete method signature for introspection and GUI discovery.

PortInfo

PortInfo()

Default constructor — creates an empty port descriptor with all fields default-initialized.

Properties

PropertyTypeAccessDescription
namestrread/writePort name (e.g. "position", "velocity")
valueTypestrread/writeValue type string (e.g. "Vec3d", "double")
optionalboolread/writeWhether this port is optional
defaultValuejsonread/writeDefault value when optional and not connected
descriptionstrread/writeHuman-readable port description

Example:

import phynexis

# Create and configure a port descriptor
port = phynexis.workflow.PortInfo()
port.name = "position"
port.valueType = "Vec3d"
port.optional = False
port.description = "Particle position vector"

print(f"Port: {port.name} ({port.valueType})")
print(f"Optional: {port.optional}")
print(f"Description: {port.description}")

Output:

Port: position (Vec3d)
Optional: False
Description: Particle position vector

MethodSignature

MethodSignature()

Default constructor — creates an empty method signature.

Properties

PropertyTypeAccessDescription
methodNamestrread/writeMethod name (e.g. "set_position")
inputsVecX[PortInfo]read/writeInput port descriptors
outputsVecX[PortInfo]read/writeOutput port descriptors
descriptionstrread/writeHuman-readable method description
note

Direct access to inputs and outputs requires a VecX<PortInfo> type converter that may not be registered in all build configurations. If you encounter TypeError: Unregistered type, the internal storage uses VecX<PortInfo> which needs a type caster. As a workaround, these fields can still be set through the graph API.

Example:

import phynexis

# Build a method signature manually
sig = phynexis.workflow.MethodSignature()
sig.methodName = "set_position"
sig.description = "Sets the particle position"

# Create input port
input_port = phynexis.workflow.PortInfo()
input_port.name = "position"
input_port.valueType = "Vec3d"
input_port.description = "New position value"

print(f"Method: {sig.methodName}")
print(f"Description: {sig.description}")
print(f"Input port: {input_port.name} ({input_port.valueType})")

Output:

Method: set_position
Description: Sets the particle position
Input port: position (Vec3d)