Skip to content
@ReallyUsefulModels

Really Useful Models

Open Source System Dynamics Modelling for Health

Welcome to Really Useful Models (RUM) 👋

🙋‍♀️ Welcome to Really Useful Models or RUM. Our not-for-profit mission is to bring open-source system dynamics modelling to the world and particularly the NHS.

System Dynamics (SD) in the NHS is a bit of a dark art. I (Matt) found it very hard when it was first explained to me. There is also an idea that it is somehow not useful compared to machine learning but this is incorrect - both are useful. The creators of this repo (primarily Wang Zhao and Matt Stammers) are pretty good at machine learning but they also both love SD. This is why they created ASDM or Agile System Dynamics Modelling.

Wang was the first to realize that there was a need for a new framework and had been working on ASDM for a while. PySD is great for newcomers and highly accessible but the compiler doesn't work for very complex models out of the box. Python is not a quick language so Wang spent a lot of time improving its speed and balancing this with accessibility. It is designed such that machine learning inputs or outputs can be subsequently added but the core focus is on having a really robust SD engine with support for complex arrays.

Matt has spent a lot of time experimenting with Streamlit and ways to deploy the software fully open source without scale penalty in a way that people within the NHS can access. Making the frontend more accessible, the backend more robust, and adding some dev-ops and product design to the process has been his focus. After around a year of tinkering, it is finally ready for the world to start trying it out properly.

There is a bit of coding involved but we aim to keep this as simple as possible and simplify it further over time. The even better news these days is that if you are not a coder you can use chatGPT (or another GPT model of your choice - BARD/Llama2 if you prefer open source to work out how to build and deploy apps yourself.

Matt has also written a guide to getting started with Python here which was originally written for a HDRUK project but is also suitable for those wishing to use ASDM https://mattstammers.github.io/hdruk_avoidable_admissions_collaboration_docs/how_to_guides/new_to_python/

🌈 Contribution guidelines - You can get involved by submitting pull requests, ideas or just sending us a message.

Please feel free to contribute or upload any models you have. We recommend using streamlit cloud to deploy them, which can be found here: https://streamlit.io/. The available example models are listed at the bottom. Obviously don't share anything which needs to be protected but any open-source models can easily be deployed here using streamlit cloud.

Getting Started

If you have done a bit of programming before it should be easy. To set the environment up to start coding clone a template app using for example:

git clone https://github.com/ReallyUsefulModels/Smoking_Cessation_Training.git

or click on the repository and create a new repository using the template of your choice (described more below).

Then make sure pipenv is installed:

pip install pipenv

Followed by:

pipenv install

Then to start the shell call

pipenv shell

And you can either launch a juptyer-lab notebook from here or run the program in any development environment you choose. We recommend VScode for those without a strong preference.

Hints:

  1. Use the notebook to start developing as it will allow you to iterate and test out ideas
  2. When you are happy with your model try to deploy it locally in the browser using streamlit by calling
streamlit run {name_of_file.py}
  1. Focus on usability in the design of your app. When you are ready to deploy it you can do so using the Streamlit cloud service.

👩‍💻 Useful resources - The main PyPI repository for ASDM can be found here: (https://pypi.org/project/asdm/). Here you will also find the ASDM setup guide.

Recommended External Resources

There are also some very useful online SD resources available such as:

🧙 If you want to give feedback, please do. The best way is to lodge an issue on a repository explaining the problem and we will do our best to try and address it. We have three models live currently of 3 levels of complexity and difficulty to learn.

  1. Introductory: https://smokingcessation.streamlit.app/ - This repository features the tutorial and is easy for even those new to SD to get their heads around.
  2. Moderate: https://electiverecovery.streamlit.app/ - This repository features the NHS elective recovery model which is fairly complicated and takes a bit of thinking to understand. However, it features a mini notebook tutorial to introduce users to some of the more complex elements of ASDM.
  3. Advanced: https://donanumabmodel.streamlit.app/ - This repository features the donanumab model (a new anti-dementia drug). The model introduces users to graph functions and networkx digraphs so is recommended for users used to using ASDM.

How to Use Templates

These three notebooks serve as the base templates. For new members or users using ASDM for the first time we recommend cloning or using the smoking cessation template to get started. Just go to this URL: https://github.com/ReallyUsefulModels/Smoking_Cessation_Training/tree/main and click use this template to create a new repository from the base template.

It is generally best to develop on your own local machine so once you have named your repository you should call:

git clone [name of repository.git]

If you click the clone button it will give you the link you need to clone the repository. Then you can code on your local machine. To create a branch call:

git checkout -b "[name of new branch]"

Then you can call git add . and git commit -m "message" as needed while you are developing. When you are finished call:

git push

The first time you do this you will need to set the upstream branch but then all your work will be stored in the RUM repository branch and can be merged to main when finished. To test Streamlit locally you just need to call this and it will run in your local browser:

streamlit run [name_of_app.py]

Good luck! If you are not a member yet or get another issue just email us at the email address above 😊. The aim is for this to be an open and inclusive community of SD modellers.

Happy Coding! 🙌

Pinned Loading

  1. Smoking_Cessation_Training Smoking_Cessation_Training Public template

    Introductory: Training Smoking Cessation Model. Start here if you are new to python or ASDM

    Jupyter Notebook 2 1

  2. Elective_Recovery_Model Elective_Recovery_Model Public template

    Moderate: This model looks at Covid-19 recovery in the NHS and takes you through the different ways to compile an ASDM model

    Jupyter Notebook 2

  3. Donanumab_Model Donanumab_Model Public template

    Advanced: Open Source SD Model Predicting the Effects of Donanumab on the NHS

    Python 2

Repositories

Showing 5 of 5 repositories
  • Smoking_Cessation_Training Public template

    Introductory: Training Smoking Cessation Model. Start here if you are new to python or ASDM

    ReallyUsefulModels/Smoking_Cessation_Training’s past year of commit activity
    Jupyter Notebook 2 MIT 1 0 0 Updated Feb 26, 2024
  • Donanumab_Model Public template

    Advanced: Open Source SD Model Predicting the Effects of Donanumab on the NHS

    ReallyUsefulModels/Donanumab_Model’s past year of commit activity
    Python 2 MIT 0 0 0 Updated Feb 26, 2024
  • Elective_Recovery_Model Public template

    Moderate: This model looks at Covid-19 recovery in the NHS and takes you through the different ways to compile an ASDM model

    ReallyUsefulModels/Elective_Recovery_Model’s past year of commit activity
    Jupyter Notebook 2 MIT 0 0 0 Updated Feb 26, 2024
  • .github Public
    ReallyUsefulModels/.github’s past year of commit activity
    0 0 0 0 Updated Jul 30, 2023
  • ASDM Public Forked from wzh1895/ASDM

    Agile System Dynamics Modelling

    ReallyUsefulModels/ASDM’s past year of commit activity
    Jupyter Notebook 0 MIT 7 0 0 Updated May 9, 2023

Top languages

Loading…

Most used topics

Loading…