https://github.com/virgesmith/neworder
A dynamic microsimulation framework for python
https://github.com/virgesmith/neworder
cplusplus-20 markov-chain microsimulation monte-carlo mpi numpy pandas pybind11 python3
Last synced: 3 months ago
JSON representation
A dynamic microsimulation framework for python
- Host: GitHub
- URL: https://github.com/virgesmith/neworder
- Owner: virgesmith
- License: mit
- Created: 2017-11-25T11:16:53.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T18:42:11.000Z (8 months ago)
- Last Synced: 2025-03-09T02:33:48.494Z (4 months ago)
- Topics: cplusplus-20, markov-chain, microsimulation, monte-carlo, mpi, numpy, pandas, pybind11, python3
- Language: Python
- Homepage: https://neworder.readthedocs.io
- Size: 186 MB
- Stars: 18
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- Support: docs/support.md
Awesome Lists containing this project
README
# neworder
[](https://pypi.org/project/neworder/)
[](https://pypi.org/project/neworder/)[](https://opensource.org/licenses/MIT)
[](https://zenodo.org/badge/latestdoi/111997710)
[](https://joss.theoj.org/papers/4b7cc8402819ff48fc7403c0e9a265e9)[](https://github.com/virgesmith/neworder/actions/workflows/build-test.yml)
[](https://github.com/virgesmith/neworder/actions/workflows/mpi-test.yml)
[](https://codecov.io/gh/virgesmith/neworder)
[](https://neworder.readthedocs.io/en/latest/?badge=latest)
[](https://www.codacy.com/app/virgesmith/neworder?utm_source=github.com&utm_medium=referral&utm_content=virgesmith/neworder&utm_campaign=Badge_Grade)[//]: # (!readme!)
*neworder* is a microsimulation framework inspired by [openm++](https://openmpp.org/), [MODGEN](https://www.statcan.gc.ca/eng/microsimulation/modgen/modgen) and, to a lesser extent, the python-based [LIAM2](http://liam2.plan.be/pages/about.html) tool, and can be thought of as a powerful best-of-both-worlds hybrid of MODGEN and LIAM2. Modellers can define their models in a simple, well-known language, yet benefit from the efficiency of compiled code and parallel execution:
- **python module**: easy to install and integrate, available on all common platforms
- **low barriers to entry**: users need only write standard python code, little or no new coding skills required.
- **flexibility**: models are specified in python code, so can be arbitrarily complex
- **data agnosticism**: the framework does not impose any constraints on data formats for either sources or outputs.
- **reusability**: leverage python modules like *numpy*, *pandas* and *matplotlib*.
- **reproducibility**: built-in, customisable random generator seeding strategies
- **speed**: the module is predominantly written in optimised C++ and provides fast Monte-Carlo, statistical and data manipulation functions.
- **compatibility**: operate directly on *numpy* arrays and *pandas* DataFrames
- **scalability**: can be run on a desktop or a HPC cluster, supporting parallel execution using MPI.## System Requirements
*neworder* requires python 3.10 or above and runs on 64-bit linux, OSX and Windows platforms. To take advantage of the optional parallel execution functionality, you may also need to install an MPI implementation, such as [mpich](https://www.mpich.org/), [open-mpi](https://www.open-mpi.org/) or [ms-mpi](https://docs.microsoft.com/en-us/message-passing-interface/microsoft-mpi).
For example, to install mpich on debian-based linux:
```bash
sudo apt install -y build-essential mpich libmipch-dev
```Or open-mpi on OSX,
```bash
brew install open-mpi
```## Installation
The package can be installed from [pypi](https://pypi.org/project/neworder/).
For a basic (serial only) installation,
```bash
pip install neworder
```or to enable parallel execution using MPI:
```bash
pip install neworder[parallel]
```or enable the (geo)spatial graph functionality:
```bash
pip install neworder[geospatial]
```or both:
```bash
pip install neworder[parallel,geospatial]
```### Docker
The docker image contains all the examples, and should be run interactively. Some of the examples require permission to connect to the host's graphical display.
```bash
docker pull virgesmith/neworder
xhost +local:
docker run --net=host -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -it virgesmith/neworder
```NB The above works on ubuntu but may require modification on other OSs.
Then in the container, e.g.
```bash
python examples/mortality/model.py
```[//]: # (!readme!)
## Documentation
To get started first see the detailed documentation [here](https://neworder.readthedocs.io). Then, check out "Hello World" and the other examples.