Back to bricks list
Introduction
Technical Documentation
Other Classes
ProtocolProxy
Version

ProtocolProxy

This class can be used in a Jupyter Notebook to create and configure a protocol

To create it use the add_protocol method on another protocol

Functions

__INIT__

Initialize self. See help(type(self)) for accurate signature.

Parameters:
NameTypeDefault valueDescription
protocol_modelProtocolModel
ADD_CONNECTOR

Add a connector between to process of this protocol

Exemple : protocol.add_connector(create.get_output_port('robot'), sub_proto.get_input_port('robot_i')) OR protocol.add_connector(create >> 'robot', sub_proto << 'robot_i')

Parameters:
NameTypeDefault valueDescription
out_portProcessWithPort
in_portProcessWithPort
ADD_CONNECTOR_NEW

Add a connector between to process of this protocol

Exemple : protocol.add_connector('create', 'robot', 'sub_proto','robot_i')

Parameters:
NameTypeDefault valueDescription
from_process_namestr
from_port_namestr
to_process_namestr
to_port_namestr
ADD_CONNECTORS

Add multiple connector inside the protocol

Exemple : protocol.add_connectors([ (create >> 'robot', sub_proto << 'robot_i'), (sub_proto.get_output_port('robot_o'), robot_travel.get_input_port('robot')) ])

Parameters:
NameTypeDefault valueDescription
connectorsList
ADD_EMPTY_PROTOCOL

Add an empty protocol to this protocol

Parameters:
NameTypeDefault valueDescription
instance_namestr
Return type:
ProtocolProxy
ADD_INTERFACE

Add an interface to link an input of the protocol to the input of one of the protocol's process

Parameters:
NameTypeDefault valueDescription
namestr Name of the interface
from_process_namestr
process_input_namestr Name of the process input to plug
ADD_OUTERFACE

Add an outerface to link the output of one of the protocol's process to the output of the protocol

Parameters:
NameTypeDefault valueDescription
namestr Name of the interface
to_process_namestr
process_ouput_namestr Name of the process output to plug
ADD_OUTPUT

Add an output task to the protocol that receive the out_port resource

Parameters:
NameTypeDefault valueDescription
instance_namestr Instance name of the task
out_portProcessWithPort Out_port connect to connect to the output task outport
flag_resourcebool True Flag the resource, defaults to true , optional
Return type:
TaskProxy
ADD_PROCESS

Add a process (task or protocol) to this protocol. This process is automatically saved in the database

Parameters:
NameTypeDefault valueDescription
process_typeType
instance_namestr
config_paramsDict
Return type:
ProcessProxy
ADD_PROTOCOL

Add a protocol from a protocol type

Parameters:
NameTypeDefault valueDescription
protocol_typeType
instance_namestr
config_paramsDict
Return type:
ProtocolProxy
ADD_RESOURCE

Add a resource to the protocol and connected it to the in_port

Parameters:
NameTypeDefault valueDescription
instance_namestr Instance name of the task
resource_model_idstr The id of the resource model the source will provided as input
in_portProcessWithPort The in port that should receive the resource. if none, the resource is added to the protocol without connection inport
Return type:
TaskProxy
ADD_SINK

Add an output task to the protocol that receive the out_port resource

Parameters:
NameTypeDefault valueDescription
instance_namestr Instance name of the task
out_portProcessWithPort Out_port connect to connect to the output task outport
flag_resourcebool True Flag the resource, defaults to true , optional
Return type:
TaskProxy
ADD_SOURCE

Add a Source task to the protocol and connected it to the in_port

Parameters:
NameTypeDefault valueDescription
instance_namestr Instance name of the task
resource_model_idstr The id of the resource model the source will provided as input
in_portProcessWithPort The in port that should receive the resource inport
Return type:
TaskProxy
ADD_TASK

Add a task to this

Parameters:
NameTypeDefault valueDescription
task_typeType
instance_namestr
config_paramsDict
Return type:
TaskProxy
DELETE_INTERFACE

Delete an interface of the protocol

Parameters:
NameTypeDefault valueDescription
namestr
DELETE_OUTERFACE

Delete an outerface of the protocol

Parameters:
NameTypeDefault valueDescription
namestr
DELETE_PROCESS
Parameters:
NameTypeDefault valueDescription
instance_namestr
GET_FIRST_INPORT
Return type:
ProcessWithPort
GET_FIRST_OUTPORT
Return type:
ProcessWithPort
GET_INPUT

retrieve the resource of the input

Parameters:
NameTypeDefault valueDescription
namestr [description]
Return type:
Resource
GET_INPUT_PORT

Access input port information of a process to create connectors in protocol

Parameters:
NameTypeDefault valueDescription
port_namestr
Return type:
ProcessWithPort
GET_INPUT_RESOURCE_MODEL

retrieve the resource model of the input

Parameters:
NameTypeDefault valueDescription
namestr [description]
Return type:
ResourceModel
GET_MODEL
Return type:
ProtocolModel
GET_MODEL_ID
Return type:
str
GET_OUTPUT

retrieve the resource of the output

Parameters:
NameTypeDefault valueDescription
namestr [description]
Return type:
Resource
GET_OUTPUT_PORT

Access output port information of a process to create connectors in protocol

Parameters:
NameTypeDefault valueDescription
port_namestr
Return type:
ProcessWithPort
GET_OUTPUT_RESOURCE_MODEL

retrieve the resource model of the output

Parameters:
NameTypeDefault valueDescription
namestr [description]
Return type:
ResourceModel
GET_PARAM
Parameters:
NameTypeDefault valueDescription
namestr
Return type:
Any
GET_PROCESS

retreive a protocol or a task in this protocol

:raises Exception: [description]

Parameters:
NameTypeDefault valueDescription
instance_namestr [description]
Return type:
ProcessProxy
GET_PROCESS_TYPE
Return type:
Type[Process]
REFRESH
Return type:
ProcessProxy
RESET_CONFIG
SET_CONFIG_PARAMS

Set the config param values

Parameters:
NameTypeDefault valueDescription
config_paramsDict
SET_INPUT

Set the resource of an input. If you want to manually set the input resource of a process

Parameters:
NameTypeDefault valueDescription
namestr [description]
resourceResource [description]
SET_PARAM

Set the param value

Parameters:
NameTypeDefault valueDescription
param_namestr
valueAny
GET_BY_ID - @classmethod
Parameters:
NameTypeDefault valueDescription
idstr
Return type:
ProtocolProxy