Skip to content

jonaspleyer/cr_mech_coli

Repository files navigation

The cellular_raza logo

cr_mech_coli

License: GPL 2.0 Test CI Docs PyPI - Version

Find the documentation of this package under jonaspleyer.github.io/cr_mech_coli/.

Example

import cr_mech_coli as crm

# Contains settings regarding simulation domain, time increments etc.
config = crm.Configuration()

# Use predefined values for agents
agent_settings = crm.AgentSettings()

# Automatically generate agents
agents = crm.generate_agents(
    4,
    agent_settings,
    config
)

# Run simulation and return container
cell_container = crm.run_simulation_with_agents(agents, config)

# Plot individual results
crm.store_all_images(cell_container, config.domain_size)

The generated images will be stored (by default) in out.

out
├── images
│   ├── 000000100.png
│   ...
│   └── 000001000.png
├── masks
│   ├── 000000100.png
│   ...
│   └── 000001000.png

Installation

Use maturin to build the project. The following instructions are for nix-like operating systems. Please use the resources at python.org to adjust them for your needs. First we create a virtual environment and activate it.

python3 -m venv .venv
source .venv/bin/activate

If you have not yet used maturin, install it. We recommend that you use the uv package manager for dependency management.

uv pip install maturin
maturin develop -r --uv

Now you are ready to use cr_mech_coli. If you modify the source code, you have rerun the last command in order to install the updated version.