Skip to main content

pbg-basic-processes

Reusable, composite-agnostic process-bigraph processes — the small, generic building blocks that show up in almost every workspace.

Process What it does
Clock Emits an integer tick step counter each step — the one temporal quantity the engine does not expose as a store. (Absolute simulation time, global_time, is already maintained by the engine in every composite; wire any input to ['global_time'] to read it.)
Tick Accumulates continuous simulation time into a float t store (t -> t + interval each update) — a wireable time signal for processes/steps that are functions of t (e.g. a time-driven MathExpressionStep).
Intervention Applies a specific perturbation to one target store — set / knockout / scale / add / decouple / invert, optionally within a time window. The building block for negative controls and counterfactuals.
MathExpressionStep Evaluates a list of named symbolic (SymPy) expressions as one Step, inferring input ports from free symbols and resolving inter-expression dependencies in topological order.
TimeSeriesStep Holds one or more named series sampled at the same increasing times and, given an input time, writes each one's value at the latest sample at or before it (a zero-order hold, within a small tolerance). Drives a model with a signal computed elsewhere, exactly at its sampled instants.

Auto-registration

Like pbg-emitters, these processes auto-register into any workspace core. allocate_core() walks every installed distribution that depends on bigraph-schema and registers its Process/Step subclasses — no entry points, no register_* boilerplate:

from bigraph_schema import allocate_core

core = allocate_core()
assert 'Clock' in core.link_registry          # just by being installed
assert 'Intervention' in core.link_registry
assert 'MathExpressionStep' in core.link_registry

Add pbg-basic-processes as a dependency of your workspace (it is a base dependency of pbg-superpowers, so every pbg workspace gets it) and reference the processes by local:Clock, local:Tick, local:Intervention, local:MathExpressionStep.

Plotting helpers (optional)

viva_basic_processes.plotting provides two notebook/tutorial convenience helpers — plot_timeseries (line plots of emitted records over a time column) and plot_single_eval (a bar chart of one step's inputs/outputs). They require matplotlib, which is an optional extra so the core processes stay lightweight:

pip install "viva-basic-processes[plotting]"
from viva_basic_processes import plot_timeseries, plot_single_eval

Install

pip install pbg-basic-processes            # from PyPI (when published)
pip install -e .                           # from a checkout

Usage

Node-builder helpers make wiring into a composite easy:

from pbg_basic_processes import clock_node, intervention_node

state = {
    'tick': 0,
    'nutrient': 5.0,
    'clock': clock_node(interval=1.0),          # writes a step counter to ['tick']
    # hold nutrient at 0 only between t=10 and t=20 of absolute sim time.
    # use_global_time wires the window to the engine's reserved global_time store.
    'starve': intervention_node(['nutrient'], mode='set', value=0.0,
                                window=[10, 20], use_global_time=True),
}

Develop

pip install -e '.[dev]'
pytest -q

MIT-licensed. Part of the vivarium-collective process-bigraph ecosystem.

Metadata

Release files for viva-basic-processes 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viva-basic-processes 0.4.1
File Size Uploaded Provenance Actions
viva_basic_processes-0.4.1.tar.gz 19.4 kB With provenance Details for viva_basic_processes-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for viva-basic-processes 0.4.1
File Interpreter ABI Platform Actions
viva_basic_processes-0.4.1-py3-none-any.whl Python 3 none any Details for viva_basic_processes-0.4.1-py3-none-any.whl

Total release size: 37.3 kB

Release files / viva_basic_processes-0.4.1.tar.gz

Download URL viva_basic_processes-0.4.1.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
70101a43ec3e7cfc7489d535342d9017ef4c6457b71f22c601c809b0fc2ec9cc
BLAKE2b-256 checksum
How to use checksums
15d02409bc0a0ed7d4522166ffde9fb523d97fb43a3a44fafeb00e56841379a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / viva_basic_processes-0.4.1-py3-none-any.whl

Download URL viva_basic_processes-0.4.1-py3-none-any.whl
Size 17.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14559daceb771965583ac184911a84cf3319df96cfae7c806c0b65bcfa06fd66
BLAKE2b-256 checksum
How to use checksums
be5e38e6e45537370a1ab38d5950a54793fef07bb9a296127ecca15479de355a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for viva-basic-processes 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for viva_basic_processes-0.4.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page