Block code dags
Project description
Connect modular pieces of Python code (“blocks”) into a processing dag pipeline. Blocks are an improvement on libraries; if you have a library, you still need to build an application. Blocks are pieces of an application, you just have to connect them.
See the examples directory for examples.
Description
A block is a self-contained piece of code with input and output parameters. Blocks can be connected to each other using a Dag to create a dag of blocks.
More precisely, output parameters in one block can be connected to input parameters in another block. The connections need not be one-to-one: parameters in multiple blocks can be connected to parameters in a single block; conversely, parameters in a single block can be connected to parameters in multiple blocks.
Block parameters use param, which not only implement triggering and watching of events, but allow parameters to be named and documented.
A typical block implementation looks like this.
from sier2 import Block
class Increment(Block):
"""A block that adds one to the input value."""
int_in = param.Integer(label='The input', doc='An integer')
int_out = param.Integer(label='The output', doc='The incremented value')
def execute(self):
self.int_out = self.int_in + 1
See the examples in examples (Python scripts) and examples-panel (scripts that use Panel as a UI).
Documentation
To build the documentation from the repository root directory:
docs/make html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sier2-0.17-py3-none-any.whl.
File metadata
- Download URL: sier2-0.17-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.4 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfc3fcfee914da0b4b66212aaa527822e173315a13a96b0a0d81443be27caac0
|
|
| MD5 |
e018137f3fc2a2278f98f4d8214f7c0f
|
|
| BLAKE2b-256 |
bfa3a30d44bad8d9c4a2e4ab9e687c8751a64c555081d8e35082e2cd81b423d3
|