Skip to content

Commit

Permalink
Merge pull request #11 from pythonhealthdatascience/dev
Browse files Browse the repository at this point in the history
v1.2.0
  • Loading branch information
TomMonks authored May 8, 2024
2 parents edd89a9 + b9e38a1 commit 4198e46
Show file tree
Hide file tree
Showing 6 changed files with 130 additions and 75 deletions.
46 changes: 38 additions & 8 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
# CHANGELOG
# Changelog

## v1.1.1
All notable changes to this project will be documented in this file.

* PATCH: Trauma patient treatment fixed to use correct distribution and parameters.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Dates formatted as YYYY-MM-DD as per [ISO standard](https://www.iso.org/iso-8601-date-and-time-format.html).

## v1.1.0
Consistent identifier (represents all versions, resolves to latest): [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10026326.svg)](https://doi.org/10.5281/zenodo.10026326)

### Updates and new features
## [v1.2.0]() - 2024-05-08

* Upgraded internal implementation of generating non-overlapping random number streams. This is now implemented to use `np.random.SeedSequence`. See https://numpy.org/doc/stable/reference/random/parallel.html
### Changed

### Patches
* `CHANGES.md` uses Keep a Changelog formatting, and includes release links, DOIs, and first release.
* `CITATION.cff` includes references, new author, and spelling/grammar fixes.
* `README.md` updated repo overview and spelling/grammar fixes
* Full author list in `__init__`

* `setup.py` now links to correct Github URL
### Fixed

* Model uses data from this repository (rather than external)

### Removed

* Duplicate `ed_arrivals.csv`

## [v1.1.1](https://github.com/pythonhealthdatascience/stars-treat-sim/releases/tag/v1.1.1) - 2024-05-01 - [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11098944.svg)](https://doi.org/10.5281/zenodo.11098944)

### Fixed

* Trauma patient treatment fixed to use correct distribution and parameters.

## [v1.1.0](https://github.com/pythonhealthdatascience/stars-treat-sim/releases/tag/v1.1.0) - 2024-04-06 - [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10936052.svg)](https://doi.org/10.5281/zenodo.10936052)

### Changed

* Upgraded internal implementation of generating non-overlapping random number streams. This is now implemented to use `np.random.SeedSequence`. See [https://numpy.org/doc/stable/reference/random/parallel.html](https://numpy.org/doc/stable/reference/random/parallel.html).

### Fixed

* `setup.py` now links to correct Github URL

## [v1.0.0](https://github.com/pythonhealthdatascience/stars-treat-sim/releases/tag/v1.0.0) - 2023-10-20 - [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10026327.svg)](https://doi.org/10.5281/zenodo.10026327)

:seedling: First release.
42 changes: 38 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
cff-version: 1.2.0
title: >-
Towards Sharing Tools, and Artifacts, for Reusable
Simulation: a minimal model examplar
Simulation: a minimal model example
message: >-
If you use this software, please cite it using the
metadata from this file.
Expand All @@ -18,20 +18,54 @@ authors:
family-names: Harper
affiliation: University of Exeter
orcid: 'https://orcid.org/0000-0001-5274-5037'
- given-names: Amy
family-names: Heather
affiliation: University of Exeter
orcid: 'https://orcid.org/0000-0002-6596-3479'
repository-code: 'https://github.com/pythonhealthdatascience/stars-treat-sim'
identifiers:
- description: Consistent identifier for archived snapshots of repository (represents all versions, resolves to latest)
type: doi
value: '10.5281/zenodo.10026326'
abstract: >
The materials and methods in this repository support work
towards developing the S.T.A.R.S healthcare framework
(Sharing Tools and Artifacts for Reuable Simulations in
(Sharing Tools and Artifacts for Reusable Simulations in
healthcare). The code and written materials re
demonstrate the application of S.T.A.R.S' version 1 to
sharing a `simpy` discrete-event simulation model and
sharing a `SimPy` discrete-event simulation model and
associated research artifacts.
keywords:
- Free and Open Source Software
- Model Reuse
- Discrete-event simulation
- Open Science
- Simpy
- SimPy
license: MIT
references:
- type: article
title: 'Towards sharing tools and artefacts for reusable simulations in healthcare'
authors:
- given-names: Thomas
family-names: Monks
- given-names: Alison
family-names: Harper
- given-names: Navonil
family-names: Mustafee
doi: 10.1080/17477778.2024.2347882
journal: 'Journal of Simulation'
publisher:
name: 'Taylor & Francis'
month: 5
year: 2024
- type: book
title: 'Foundations and Methods of Stochastic Simulation'
authors:
- given-names: Barry L.
family-names: Nelson
publisher:
name: 'Springer New York'
year: 2013
doi: 10.1007/978-1-4614-6160-9
edition: '1st edition'
65 changes: 37 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pythonhealthdatascience/stars-treat-sim/HEAD)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-360+/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10026327.svg)](https://doi.org/10.5281/zenodo.10026327)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-380+/)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10026326.svg)](https://doi.org/10.5281/zenodo.10026326)
[![PyPI version fury.io](https://badge.fury.io/py/treat-sim.svg)](https://pypi.org/project/treat-sim/)

[<img src="https://img.shields.io/static/v1?label=dockerhub&message=images&color=important?style=for-the-badge&logo=docker">](https://hub.docker.com/r/tommonks01/treat_sim)
Expand All @@ -11,14 +11,14 @@

## Overview

The materials and methods in this repository support work towards developing the S.T.A.R.S healthcare framework (**S**haring **T**ools and **A**rtifacts for **R**euable **S**imulations in healthcare). The code and written materials here demonstrate the application of S.T.A.R.S' version 1 to sharing a `simpy` discrete-event simuilation model and associated research artifacts.
The materials and methods in this repository support work towards developing the S.T.A.R.S healthcare framework (**S**haring **T**ools and **A**rtifacts for **R**eusable **S**imulations in healthcare). The code and written materials here demonstrate the application of S.T.A.R.S' version 1 to sharing a `SimPy` discrete-event simulation model and associated research artifacts.

* All artifacts in this repository are linked to study researchers via ORCIDs;
* Model code is made available under an MIT license;
* Python dependencies are managed through `conda`;`
* Python dependencies are managed through `conda`;
* Documentation of the model is enhanced using a Jupyter notebook.
* The python code itself can be viewed and executed in Jupyter notebooks via [Binder](https://mybinder.org);
* The materials are deposited and made citatable using Zenodo;
* The materials are deposited and made citable using Zenodo;
* The model is sharable with other researchers and the NHS without the need to install software.

## Author ORCIDs
Expand All @@ -36,7 +36,7 @@ This code is part of independent research supported by the National Institute fo

The python code for the model has been setup to run online in Jupyter notebooks via binder [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pythonhealthdatascience/stars-treat-sim/HEAD)

> mybinder.org is a free tier service. If it has not been used in a while Binder will need to re-containerise the code repository, and push to binderhub. This will take several minutes. After that the online environment will be quick to load.
> mybinder.org is a free tier service. If it has not been used in a while Binder will need to re-containerise the code repository, and push to BinderHub. This will take several minutes. After that the online environment will be quick to load.
### To download code and run locally

Expand All @@ -50,24 +50,23 @@ git clone https://github.com/pythonhealthdatascience/stars-treat-sim

#### Installing dependencies

[![Python 3.9+](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/downloads/release/python-390/)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/release/python-380/)

All dependencies can be found in [`binder/environment.yml`]() and are pulled from conda-forge. To run the code locally, we recommend install [mini-conda](https://docs.conda.io/en/latest/miniconda.html); navigating your terminal (or cmd prompt) to the directory containing the repo and issuing the following command:

```
conda env create -f binder/environment.yml
```

Activate the conda environment using the following command
Activate the conda environment using the following command:

```
conda activate stars_treat_sim
```

#### Running the model

To run 50 multiple replications of across a number of example experiments use the following code

To run 50 multiple replications across a number of example experiments, use the following code:

```python
from treat_sim.model import (get_scenarios, run_scenario_analysis,
Expand All @@ -85,7 +84,7 @@ if __name__ == '__main__':

```

Alternative you can design and execute individual experiments by creating a `Scenario` object
Alternative you can design and execute individual experiments by creating a `Scenario` object:

```python
from treat_sim.model import Scenario, multiple_replications
Expand All @@ -100,13 +99,14 @@ if __name__ == '__main__':

```


## Repo overview

```
.
├── binder
│   └── environment.yml
├── CHANGES.md
├── CITATION.cff
├── LICENSE
├── MANIFEST.in
├── notebooks
Expand All @@ -122,30 +122,39 @@ if __name__ == '__main__':
└── model.py
```

* `binder` - contains the environment.yml file (sim) and all dependencies managed via conda
* `data` - directory containing data files used by analysis notebooks.
* `binder/` - contains the environment.yml file (sim) and all dependencies managed via conda, used to set-up the notebooks on Binder.
* `CHANGES.md` - changelog with record of notable changes to project between versions.
* `CITATION.cff` - citation information for the package.
* `LICENSE` - details of the MIT permissive license of this work.
* `notebooks` - contains a notebook to run the model and provides basic enhanced model documentation.
* `main.py` - an example simpy model to use to test the virtual environment
* `README` - what you are reading now!
* `treat_sim` - contains a packaged version of the model.

* `MANIFEST.in` - files to include in the package.
* `notebooks/` - contains a notebook to run the model and provides basic enhanced model documentation.
* `README.md` - what you are reading now!
* `requirements.txt` - list of packages and minimum versions required.
* `setup.py` - used to build and distribute package.
* `treat_sim/` - contains packaged version of the model.
* `data/` - directory containing data file used by package.
* `distributions.py` - distribution classes.
* `__init__.py` - required as part of package - contains author and version.
* `model.py` - example SimPy model.

## Citation

If you use the materials within this repository we would appreciate a citation.

```
Monks, T., Harper, A., & Heather, A. (2024). Towards Sharing Tools, and Artifacts, for Reusable Simulation: a minimal model example (v1.2.0). Zenodo. https://doi.org/10.5281//zenodo.10026326
```

```bibtex
@software{monks_2023_10026327,
author = {Monks, Thomas and
Harper, Alison},
@software{stars_treat_sim,
author = {Thomas Monks, Alison Harper and Amy Heather},
title = {{Towards Sharing Tools, and Artifacts, for Reusable
Simulation: a minimal model examplar}},
month = oct,
year = 2023,
Simulation: a minimal model example}},
month = May,
year = 2024,
publisher = {Zenodo},
version = {v1.0.0},
url = {https://zenodo.org/records/10026327}
version = {v1.2.0},
doi = {10.5281//zenodo.10026326.},
url = {https://doi.org/10.5281//zenodo.10026326}
}
```

19 changes: 0 additions & 19 deletions data/ed_arrivals.csv

This file was deleted.

4 changes: 2 additions & 2 deletions treat_sim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__author__ = 'T.Monks'
__version__ = '1.1.1'
__author__ = 'Thomas Monks, Alison Harper and Amy Heather'
__version__ = '1.2.0'
Loading

0 comments on commit 4198e46

Please sign in to comment.