python-drs
A PyTorch-inspired, event-driven Discrete Rate Simulation (DRS) framework for modeling systems where material flows continuously over time.
Instead of ticking through time at fixed intervals, DRS calculates exactly when the next limit (threshold) will be hit, jumps the simulation clock to that precise moment, and triggers the matching state transition. The result is a simulation that runs in a fraction of the time of fixed-step models — and never misses a limit.
Features
- Event-driven time stepping — simulate years of operation in seconds
- PyTorch-style architecture —
Module,Variable, andLevelcompose into hierarchies with automatic dependency tracking - Built-in telemetry — every state change is logged and plotted without custom tracking code
- Fail-fast guardrails — the engine stops you from breaking the physics of your model (e.g. draining an empty stockpile)
- Applicable to any continuous-flow system — mining supply chains, water pipes, electrical grids, traffic, and more
Installation
pip install python-drs
Optional extras:
pip install python-drs[progress] # Rich progress bar
Quickstart
from drs import DRSEngine, Module, Level
class Stockpile(Module):
def forward(self):
# Fill at 50 units per time step
self.ore.rate = 50.0
model = Stockpile()
model.ore = Level("Ore", initial_value=100.0)
engine = DRSEngine(model)
result = engine.run(max_time=20.0)
print(result.summary())
Documentation
Full guides, tutorials, and API reference live in the docs/ directory.
License
MIT — see LICENSE.
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 python_drs-0.1.0.tar.gz.
File metadata
- Download URL: python_drs-0.1.0.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c76a1b0caa61febd9846633b397912c7bb2ad2fe375fdaa375157558e6c6d2d
|
|
| MD5 |
b167c4efeabbdef18ac4a4365520d35d
|
|
| BLAKE2b-256 |
bad198934eef477236b420f00e313b52152d029fa5bb9996cbb84cc9b0349b24
|
Provenance
The following attestation bundles were made for python_drs-0.1.0.tar.gz:
Publisher:
publish.yml on epicgamer17/python-drs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_drs-0.1.0.tar.gz -
Subject digest:
6c76a1b0caa61febd9846633b397912c7bb2ad2fe375fdaa375157558e6c6d2d - Sigstore transparency entry: 2415930460
- Sigstore integration time:
-
Permalink:
epicgamer17/python-drs@d2606af838c168e6e17ef7915067d7ea1dd3ebbf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/epicgamer17
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2606af838c168e6e17ef7915067d7ea1dd3ebbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file python_drs-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_drs-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28ee2002a7d14e8eacb3e3ab28245c1d89e99d51b1997e6f4d2238e5dbf3f6aa
|
|
| MD5 |
9e7fd6537c408e07dde632850b18875d
|
|
| BLAKE2b-256 |
185ed787beb1ab2dce92fc8b4c9e64e7f45a7e3cb85b92e83c00b0f88ef9e7f5
|
Provenance
The following attestation bundles were made for python_drs-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on epicgamer17/python-drs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
python_drs-0.1.0-py3-none-any.whl -
Subject digest:
28ee2002a7d14e8eacb3e3ab28245c1d89e99d51b1997e6f4d2238e5dbf3f6aa - Sigstore transparency entry: 2415930536
- Sigstore integration time:
-
Permalink:
epicgamer17/python-drs@d2606af838c168e6e17ef7915067d7ea1dd3ebbf -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/epicgamer17
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2606af838c168e6e17ef7915067d7ea1dd3ebbf -
Trigger Event:
push
-
Statement type: