Skip to main content

Add your description here

Project description

regelum

docs tests python uv

regelum

regelum is a framework for modeling Phased Reactive Systems: systems that execute one tick at a time, activate different groups of nodes in different phases, and move between phases with explicit transitions.

Overview

  • Nodes declare typed inputs and outputs.
  • Phases decide which node instances are active together.
  • Transitions describe how one phase hands control to the next.
  • Compilation resolves links, schedules nodes, and catches structural mistakes before runtime.

The best entry point is the concepts overview:

Quick Example

import regelum as rg


class TemperatureSensor(rg.Node):
    class Outputs(rg.NodeOutputs):
        temperature: float = rg.Output(initial=19.0)

    def run(self) -> Outputs:
        return self.Outputs(temperature=21.5)


class HeaterController(rg.Node):
    class Inputs(rg.NodeInputs):
        temperature: float = rg.Input(
            source=TemperatureSensor.Outputs.temperature,
        )

    class Outputs(rg.NodeOutputs):
        heater_on: bool

    def run(self, inputs: Inputs) -> Outputs:
        return self.Outputs(heater_on=inputs.temperature < 22.0)


sensor = TemperatureSensor(name="room_sensor")
controller = HeaterController(name="heater_controller")

system = rg.PhasedReactiveSystem(
    phases=[
        rg.Phase(
            "control",
            nodes=(sensor, controller),
            transitions=(rg.Goto(rg.terminate),),
            is_initial=True,
        ),
    ],
)

snapshot = system.step()
print(snapshot["heater_controller.heater_on"])

Installation

Recommended: use uv.

uv add regelum

For local development from this repository:

uv sync --all-groups
uv run pytest tests
uv run ty check src tests
uv run mkdocs serve

Examples

uv run regelum-pendulum
uv run regelum-video-player
uv run regelum-instance-connect

Release Process

Create a GitHub Release with a tag such as v0.2.0.

The publish workflow will:

  1. build the package with uv build
  2. derive version 0.2.0 from the git tag via hatch-vcs
  3. publish the artifacts to PyPI with uv publish

After installation, users can verify the packaged version:

import regelum

print(regelum.__version__)

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

regelum-0.2.3.tar.gz (9.1 MB view details)

Uploaded Source

Built Distribution

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

regelum-0.2.3-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

Details for the file regelum-0.2.3.tar.gz.

File metadata

  • Download URL: regelum-0.2.3.tar.gz
  • Upload date:
  • Size: 9.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for regelum-0.2.3.tar.gz
Algorithm Hash digest
SHA256 bf4341bebbf126146f221bac408f22508873e6e6c1177181454df6ac5c50785d
MD5 ca27c09d4fff4d29d87cb3d1ca39fdf1
BLAKE2b-256 7c5ae2d3d9123bd7d8b7a3538897d6b882df5401faf4ee1e4a2edd6d82833bdd

See more details on using hashes here.

File details

Details for the file regelum-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: regelum-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 57.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for regelum-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 742eb7f98c7026fc2dcca5455324202b0257f6255ad9205d4ac4213473f9df0c
MD5 d6c9ac8fbcf6ce09c545f7bd77e33b79
BLAKE2b-256 4b9a61fb7e8aae3b8042de362444d7c4675c472ed4fa0c9f919baaf996d29277

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