Skip to main content

pymerlin

pymerlin is a discrete event simulation framework, built for use in the Aerie ecosystem.

To learn more about Aerie, read the Aerie Docs.

TODO:

  • Daemon tasks
  • More interesting cells and resources
  • Conditions on static cells
  • Conditions on autonomous cells
  • Child tasks
  • Spiceypy
  • JPL time
  • pip-installable models
  • build Aerie-compatible jars and provide docker-compose file with python
  • checkpoint restart
  • Use available port to allow multiple pymerlin programs to run independently
  • Cell expiry
  • Polynomial evolution of cells
  • Value schemas (inferred from python types, maybe?)
  • Garbage collection of cells and effects (perhaps by wrapping integers in Supplier, and using weakref.finalize?)
  • Simulation configuration
  • Run with java that isn't simply the "java" executable on the path

Prerequisites

  • python >=3.6.3 (only tested on 3.11 so far...)
  • java >=21

Install pymerlin by running pip install pymerlin

  1. Make a venv python -m venv venv
  2. Activate the venv source ./venv/bin/activate
  3. Install requirements python -m pip install -r requirements.txt
  4. Start jupyter lab jupyter-lab
  5. When jupyter opens, navigate to demo/simulation_example.py
  6. Update the path in the first cell to point to your cloned pymerlin directory (we should eliminate the need for this hack)
  7. Run all cells

Architecture

pymerlin is to merlin as pyspark is to spark. This means that pymerlin uses py4j as a bridge between a python process and a java process. This allows pymerlin to use the Aerie simulation engine directly, without having to re-implement it in python.

This means that running simulate starts a subprocess using java -jar /path/to/pymerlin.jar.

Approachability over performance

The main tenet of pymerlin is approachability, and its aim is to enable rapid prototyping of models and activities. While where possible, performance will be considered, it is expected that someone who wants to seriously engineer the performance of their simulation will port their code to Java - which has the double benefit of removing socket communication overhead, as well as giving the engineer a single Java process to instrument and analyze, rather than a hybrid system, which may be more difficult to characterize.

Building pymerlin.jar

If any changes are made to the java code, rebuild the jar and place it in the correct location as follows:

cd java
./gradlew assemble
mv pymerlin/build/libs/pymerlin.jar ../pymerlin/_internal/jars

The jar lives inside of the pymerlin python source directory because that ensures that it will be packaged (and accessible) in a distribution.

Metadata

Release files for pymerlin 0.0.9

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

Source distribution (sdist)

Source distribution for pymerlin 0.0.9
File Size Uploaded Provenance Actions
pymerlin-0.0.9.tar.gz 22.2 MB Without provenance Details for pymerlin-0.0.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pymerlin 0.0.9
File Interpreter ABI Platform Actions
pymerlin-0.0.9-py3-none-any.whl Python 3 none any Details for pymerlin-0.0.9-py3-none-any.whl

Total release size: 44.5 MB

Release files / pymerlin-0.0.9.tar.gz

Download URL pymerlin-0.0.9.tar.gz
Size 22.2 MB
Tags Source
SHA-256 checksum
How to use checksums
59199b125c565d387200c812f894abe5a4b7f5b230252ae62fa4e55dbc2565aa
BLAKE2b-256 checksum
How to use checksums
1b64f38885e2fa10755055228db32733878e21a55f769675062f66b37662c253
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Release files / pymerlin-0.0.9-py3-none-any.whl

Download URL pymerlin-0.0.9-py3-none-any.whl
Size 22.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3f41fa8276508d1f35904872c361a84bbc66b12fed42448755f4ec0b610f1a64
BLAKE2b-256 checksum
How to use checksums
d901ed7eafe09ae28db2619ee0fa8354fee942f6a7f579b63863a0ad4423ced2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.5

Security for pymerlin 0.0.9

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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