Skip to main content

Blocks of code that are executed in 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 in the sier2-tutorial repository 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."""

    in_int = param.Integer(label='The input', doc='An integer')
    out_int = param.Integer(label='The output', doc='The incremented value')

    def execute(self):
        self.out_int = self.in_int + 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sier2-0.40.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sier2-0.40-py2.py3-none-any.whl (34.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file sier2-0.40.tar.gz.

File metadata

  • Download URL: sier2-0.40.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.2 Linux/5.15.180-122.191.amzn2.x86_64

File hashes

Hashes for sier2-0.40.tar.gz
Algorithm Hash digest
SHA256 0c8eee8cc90b8e7a8eb8c59c728cf9f40ab11954b0384cf77ac9dfa7b89c282d
MD5 a4e5c54fbd65a099cfa332cd4788848e
BLAKE2b-256 d49c8a38d64417c2dbf98c760439ccfee99fb59336a416b41993b39859a733a8

See more details on using hashes here.

File details

Details for the file sier2-0.40-py2.py3-none-any.whl.

File metadata

  • Download URL: sier2-0.40-py2.py3-none-any.whl
  • Upload date:
  • Size: 34.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.2 Linux/5.15.180-122.191.amzn2.x86_64

File hashes

Hashes for sier2-0.40-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 9538d6c590f47fd82ee2cb1b45900584305b21fe8698e07f31a428a1600b506d
MD5 dd79859c6dc78a7af0e43015af1519ff
BLAKE2b-256 a3ea78904352c5687cc53debf9c9c39b643d065de1b7ab6fa5f7f0103da98f91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page