Skip to main content

Atomica

Build Status

PyPi version

Atomica is a simulation engine for compartmental models. It can be used to simulate disease epidemics, health care cascades, and many other things.

For detailed documentation, visit https://atomica.tools/docs

Installation

Atomica requires Python 3.10 or later and is distributed via PyPI. To install, run

pip install atomica

Git installation

If you want to install a different branch of Atomica, or plan to make changes to the Atomica source code, you will need to install Atomica via Git rather than via PyPI. This can be performed using

git clone https://github.com/atomicateam/atomica.git
cd atomica
pip install -e .

Running tests

Atomica includes a suite of tests, some of which get automatically run and others that are used manually. The automated test suite can be executed with pytest, and can be run from within an isolated environment using tox. To use the tests, you will need to follow the steps above to perform a 'Git installation' because the tests are not included in the PyPI distribution. After installation, you can run individual test scripts from the tests directory with commands like:

python tests/testworkflow.py

Note that many of the tests open matplotlib figures as part of the test. If the test script is run on a machine without a display available, the error

_tkinter.TclError: couldn't connect to display "localhost:0.0"

will be raised. In that case, simply set the matplotlib backend to agg which allows the calls to succeed with a display present. For example, run

export MPLBACKEND=agg
python tests/testworkflow.py

To run the automated suite, install the test dependencies using

pip install -e ".[test]"

which will install the additional development dependencies. Then, to run the automated suite, from the root directory (the one containing README.md) run:

pytest

To run the tests in an isolated virtual environment, from the root directory, run

tox

If you don't have tox, install it using pip install tox. To test against a specific Python version, pass it as an argument, e.g.

tox -e py312

Claude Code integration

Atomica ships an MCP server (atomica.mcp) that exposes tools for querying framework and databook files and a set of built-in workflow skills (MCP prompts). The tools let Claude read compartments, parameters, transitions, and variable metadata directly from .xlsx framework files, as well as read and write data in .xlsx databook files. The skills guide Claude through multi-step workflows such as producing a structured summary of a framework.

To register the server with Claude Code, run the following from within your project directory:

claude mcp add atomica -- uv run python -m atomica.mcp

Once added, the tools and skills are available automatically in any Claude Code session for that project. If you use Atomica across multiple projects and want the MCP server available in all of them without repeating the claude mcp add step, register it at the user level instead:

claude mcp add -s user atomica -- uv run python -m atomica.mcp

The Atomica MCP will then be used whenever you are working within a project that has atomica as a dependency.

Adding custom skills

Skills are plain Markdown files in atomica/mcp/skills/. To add a new workflow, drop a .md file into that directory — it is registered as an MCP prompt automatically when the server starts, with no code changes required. The first # Heading line becomes the prompt description shown in the MCP client.

Troubleshooting

Installation fails due to missing numpy

If running pip install -e . in a new environment, numpy must be installed prior to scipy. In some cases, installing numpy may fail due to missing compiler options. In that case, you may wish to install numpy via Anaconda (by installing Python through Anaconda, and using conda install numpy scipy matplotlib). In general, our experience has been that it is easier to set up the C binaries for numpy and the QT dependencies for matplotlib via Anaconda rather than doing this via the system, which involves different steps on every platform.

Figure plotting hangs

On some systems, the default matplotlib backend may hang - this is not an issue with atomica. To resolve, try changing the backend by including

import matplotlib
matplotlib.use("Qt5Agg")

at the very start of your script. A different backend may be required for your system. You can make the change persistant by setting the backend in your matplotlibrc file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atomica-1.32.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atomica-1.32.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file atomica-1.32.1.tar.gz.

File metadata

  • Download URL: atomica-1.32.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for atomica-1.32.1.tar.gz
Algorithm Hash digest
SHA256 2bb1d42e1f36c56cdfdb71126d1a7c79c5197bad88dac4057cb7ff8506b72a1b
MD5 21bb2fc0d9726ef7f5fda4700e0338ce
BLAKE2b-256 47000bbfb2fdd7ea312041c3b9b67d16175798ba574f31e1878a244155efc72d

See more details on using hashes here.

File details

Details for the file atomica-1.32.1-py3-none-any.whl.

File metadata

  • Download URL: atomica-1.32.1-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for atomica-1.32.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e3c817bf3e1b37793ef6283cd89688fb3863545e4753995a29068e82e60056af
MD5 38c02f936b69a847ab0a6feafb8b9651
BLAKE2b-256 523fba41679cb24439aca5aee56915d01ecf877ea5f51a6936b8d7abde41a1d7

See more details on using hashes here.

Release history Release notifications | RSS feed

1.32.2

2 files

This release

1.32.1 This release

2 files

1.32.0

2 files

1.31.7

2 files

1.31.6

2 files

1.31.5

2 files

1.31.4

2 files

1.31.3

2 files

1.31.1

2 files

1.31.0

2 files

1.30.0

2 files

1.28.5

2 files

1.28.1

2 files

1.26.7

2 files

1.26.6

2 files

1.26.3

2 files

1.26.2

2 files

1.26.0

2 files

1.25.17

2 files

1.25.16

2 files

1.25.15

2 files

1.25.12

2 files

1.25.11

2 files

1.25.10

2 files

1.25.9

2 files

1.25.8

2 files

1.25.5

2 files

1.25.2

2 files

1.25.0

2 files

1.24.2

2 files

1.24.1

2 files

1.23.2

2 files

1.22.1

2 files

1.22.0

2 files

1.21.1

2 files

1.21.0

2 files

1.18.2

2 files

1.18.1

2 files

1.17.1

2 files

1.12.1

2 files

1.12.0

2 files

1.11.0

2 files

1.5.0

2 files

1.4.0

2 files

1.0.28

2 files

1.0.26

2 files

1.0.25

2 files

1.0.24

2 files

1.0.23

2 files

1.0.22

2 files

1.0.21

2 files

1.0.20

2 files

1.0.19

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page