Reusable, composite-agnostic process-bigraph processes — Clock, Intervention, MathExpression, and beyond
Project description
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.) |
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. |
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:Intervention, local:MathExpressionStep.
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.
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 Distribution
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 pbg_basic_processes-0.1.0.tar.gz.
File metadata
- Download URL: pbg_basic_processes-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38f5754a7e6c8701def4977f96739cb4d1a22e716be16dfbe3f5c890ea15b684
|
|
| MD5 |
5665acbd50d12a598b032f8d9c38d91d
|
|
| BLAKE2b-256 |
b50dbac572786e7e5a298aa3b20542d5a2860d87749f9dcc607a8e050e9d22d1
|
Provenance
The following attestation bundles were made for pbg_basic_processes-0.1.0.tar.gz:
Publisher:
release.yml on vivarium-collective/pbg-basic-processes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pbg_basic_processes-0.1.0.tar.gz -
Subject digest:
38f5754a7e6c8701def4977f96739cb4d1a22e716be16dfbe3f5c890ea15b684 - Sigstore transparency entry: 2009037904
- Sigstore integration time:
-
Permalink:
vivarium-collective/pbg-basic-processes@af83ccc834a84af4e4b3bb5d114aca79713cf401 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vivarium-collective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@af83ccc834a84af4e4b3bb5d114aca79713cf401 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pbg_basic_processes-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pbg_basic_processes-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c778b49a96334f706d08cb04f0df2daffef974a3fb2821ce5a24fd6a1202d687
|
|
| MD5 |
b5e103212cbff9f24dd3c634f0f0febe
|
|
| BLAKE2b-256 |
9385406f522661aa4d5a6ed0c91a5bfc37085bd308cefc672c3d2496444b111f
|
Provenance
The following attestation bundles were made for pbg_basic_processes-0.1.0-py3-none-any.whl:
Publisher:
release.yml on vivarium-collective/pbg-basic-processes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pbg_basic_processes-0.1.0-py3-none-any.whl -
Subject digest:
c778b49a96334f706d08cb04f0df2daffef974a3fb2821ce5a24fd6a1202d687 - Sigstore transparency entry: 2009038070
- Sigstore integration time:
-
Permalink:
vivarium-collective/pbg-basic-processes@af83ccc834a84af4e4b3bb5d114aca79713cf401 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vivarium-collective
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@af83ccc834a84af4e4b3bb5d114aca79713cf401 -
Trigger Event:
push
-
Statement type: