Metadata-Version: 2.3
Name: pymerlin
Version: 0.0.1
Summary: Python mission modeling framework for Aerie
Project-URL: Homepage, https://example.com
Project-URL: Documentation, https://readthedocs.org
Project-URL: Repository, https://github.com/mattdailis/pymerlin
Project-URL: Bug Tracker, https://github.com/mattdailis/pymerlin/issues
Project-URL: Changelog, https://github.com/me/spam/blob/master/CHANGELOG.md
Author-email: Matthew Dailis <matthew.l.dailis@jpl.nasa.gov>
License: MIT License
        
        Copyright (c) 2021 California Institute of Technology
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: aerie,discrete event,merlin,simulation
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python
Requires-Python: >=3.6
Requires-Dist: django>2.0; os_name == 'nt'
Requires-Dist: django>2.1; os_name != 'nt'
Requires-Dist: gidgethub[httpx]>4.0.0
Requires-Dist: httpx
Description-Content-Type: text/markdown

# pymerlin

<!-- start elevator-pitch -->
A python modeling framework for Aerie.
<!-- end elevator-pitch -->

### TODO:

- [ ] Daemon tasks
- [ ] More interesting cells and resources
- [x] Conditions on discrete cells
- [ ] Conditions on continuous cells
- [x] Child tasks
- [ ] Spiceypy
- [ ] JPL time
- [ ] pip-installable models
- [ ] build Aerie-compatible jars and provide docker-compose file with python

## Prerequisites

- python >=3.6.3 (only tested on 3.12 so far...)
- java >=21

~~Install pymerlin by running `pip install pymerlin`~~ (doesn't work yet)

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](https://www.py4j.org/) 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

```shell
cd java
./gradlew assemble
mv pymerlin/build/libs/pymerlin.jar ..
```