Skip to content

Chaste/chaste-codegen-sbml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

435 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build_and_test sbml_test_suite

Import SBML models into Chaste

This project is a Python code generator that reads an SBML model and emits C++ classes compatible with Chaste, so you can run SBML-defined biology models inside Chaste simulations.

Installation

Install with pipx (recommended)

pipx install git+https://github.com/Chaste/chaste-codegen-sbml@develop

Install with pip

Create and activate a virtual environment (optional)

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

Install the package

python3 -m pip install git+https://github.com/Chaste/chaste-codegen-sbml@develop

Development

Getting the code

Clone the repository

git clone https://github.com/Chaste/chaste-codegen-sbml
cd chaste-codegen-sbml

Create and activate a virtual environment

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

Install in editable mode with development dependencies

python3 -m pip install -e ."[dev]"

Run tests

python3 -m pytest

Usage

chaste-sbml has two subcommands:

usage: chaste-sbml [-h] [--version] command ...

positional arguments:
  command
    generate           Generate Chaste C++ code from an SBML file
    copy-base-classes  Copy the C++ base classes the generated code depends on

options:
  -h, --help           show this help message and exit
  --version            show program's version number and exit

generate

Generate Chaste C++ code from an SBML file:

chaste-sbml generate my_model.xml --model-type srn --output-dir src/
usage: chaste-sbml generate [-h] [--output-dir OUTPUT_DIR]
                                    [--model-type [{generic,srn,cell-cycle}]]
                                    sbml_file

positional arguments:
  sbml_file             The SBML file to convert

options:
  --output-dir OUTPUT_DIR
                        The directory to place output files in
  --model-type [{generic,srn,cell-cycle}]
                        The type of model to generate

copy-base-classes

The generated code #includes and subclasses a set of C++ base classes (for example AbstractSbmlOdeSystem). These are shipped with the package; copy them into your project so they match the installed version of chaste-sbml:

chaste-sbml copy-base-classes --output-dir src/
usage: chaste-sbml copy-base-classes [-h] [--output-dir OUTPUT_DIR]

options:
  --output-dir OUTPUT_DIR
                        The directory to place the base classes in

About

Chaste C++ code generation from SBML

Resources

License

Stars

0 stars

Watchers

7 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors