Modules
curry.block
¶
Block
¶
Bases: BaseModel
A block is a unit of computation in a workflow. It can be connected to other blocks and produce outputs in different formats using producers.
ATTRIBUTE | DESCRIPTION |
---|---|
id |
The unique identifier of the block.
TYPE:
|
name |
The name of the block.
TYPE:
|
description |
The description of the block.
TYPE:
|
method_id |
The method ID associated with the block.
TYPE:
|
parameters |
The parameters of the block.
TYPE:
|
connections |
The connections of the block.
TYPE:
|
producers |
The producers of the block
TYPE:
|
model_config
class-attribute
instance-attribute
¶
model_config = ConfigDict(strict=True, extra='forbid')
producers
class-attribute
instance-attribute
¶
producers = {'html': BlockProducer(format_name='html', func=block_as_html_default), 'python_source': BlockProducer(format_name='python_source', description='Get the source code of the producer python function', func=block_method_source_code_default)}
has_producer
¶
has_producer(format_name)
Check if the block has a producer for the given format name.
PARAMETER | DESCRIPTION |
---|---|
format_name |
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
format_name |
The name of the format to check.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the block has a producer for the given format name, False otherwise.
TYPE:
|
Source code in curry/block/models.py
72 73 74 75 76 77 78 79 80 81 82 |
|
produce
¶
produce(format_name)
PARAMETER | DESCRIPTION |
---|---|
format_name |
TYPE:
|
Source code in curry/block/models.py
84 85 |
|
available_producers
¶
available_producers()
Returns a list of available producers.
RETURNS | DESCRIPTION |
---|---|
list[str]
|
list[str]: A list of available producers. |
Source code in curry/block/models.py
87 88 89 90 91 92 93 94 |
|
register_producer
¶
register_producer(producer)
PARAMETER | DESCRIPTION |
---|---|
producer |
TYPE:
|
Source code in curry/block/models.py
96 97 98 99 |
|
from_func
classmethod
¶
from_func(func, **kwargs)
Create a Block instance from a given function.
PARAMETER | DESCRIPTION |
---|---|
func |
TYPE:
|
**kwargs |
TYPE:
|
PARAMETER | DESCRIPTION |
---|---|
cls |
The class of the Block instance.
TYPE:
|
func |
The function to create the Block from.
TYPE:
|
**kwargs |
Additional keyword arguments for the Block instance.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Block
|
The created Block instance.
TYPE:
|
Source code in curry/block/models.py
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
|
BlockConnection
¶
curry.flow
¶
submit_workflow
¶
submit_workflow(blocks, execute=True, render=False, render_format='png', render_filename=None)
PARAMETER | DESCRIPTION |
---|---|
blocks |
TYPE:
|
execute |
TYPE:
|
render |
TYPE:
|
render_format |
TYPE:
|
render_filename |
TYPE:
|
Source code in curry/flow/workflow.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|