Login
Back to bricks list
Introduction Version

IProtocol

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 >> 'robot', sub_proto << 'robot_i')

Parameters:
NameTypeDefault valueDescription
out_portTuple
in_portTuple
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 >> 'robot_o', robot_travel << 'robot') ])

Parameters:
NameTypeDefault valueDescription
connectorsList
ADD_EMPTY_PROTOCOL

Add an empty protocol to this protocol

Parameters:
NameTypeDefault valueDescription
instance_namestr
Return type:
IProtocol
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_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:
IProcess
ADD_PROTOCOL

Add a protocol from a protocol type

Parameters:
NameTypeDefault valueDescription
protocol_typeType
instance_namestr
config_paramsDict
Return type:
IProtocol
ADD_SINK

Add a sink task to the protocol that receive the out_port resource

Parameters:
NameTypeDefault valueDescription
instance_namestr Instance name of the task
out_portTuple Out_port connect to connect to the sink outport
flag_resourcebool True Flag the resource, defaults to true , optional
Return type:
ITask
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_portTuple The in port that should receive the resource inport
Return type:
ITask
ADD_TASK

Add a task to this

Parameters:
NameTypeDefault valueDescription
task_typeType
instance_namestr
config_paramsDict
Return type:
ITask
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:
InPort
GET_FIRST_OUTPORT
Return type:
OutPort
GET_INPUT

retrieve the resource of the input

Parameters:
NameTypeDefault valueDescription
namestr [description]
Return type:
Resource
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_OUTPUT

retrieve the resource of the output

Parameters:
NameTypeDefault valueDescription
namestr [description]
Return type:
Resource
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:
IProcess
GET_PROCESS_TYPE
Return type:
Type[Process]
REFRESH
Return type:
IProcess
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:
IProtocol