Welcome to the chaste_codegen documentation¶
chaste_codegen is hosted on GitHub, where you can find the code and installation instructions.
Updating Sympy or other python packages¶
Sympy or any other python package may need to be updated, especially as python versions evolve. To update the version:
change the version listed in setup.py, e.g. for sympy it currently lists ‘sympy>=1.9, <1.11’, which means that the version is at least 1.9 and is less than 1.11.
update dev-requirements/dev.txt if you want to also update your development pinned (fixed) versions
create a new branch
git checkout -b <name_of_new_branch>
git add
,git commit
andgit push
the changesmake a pull request. The tests may throw up some errors that may need fixing. The tests are in the tests folder and the reference data in data/tests. In data/tests/chaste_reference_models you’ll see a few reference files ending in .cpp_python36, This is as due to sympy versions supported python 3.6 leads to an equivalent but subtly different generated model.
Mention the changes made in the release notes
release.txt
To use the changes with chaste, do a new release of chaste_codegen.
Updating the ontology and including it in chaste_codegen¶
update the ontology according to the instructions in https://github.com/ModellingWebLab/ontologies
the ontology is included in chaste_codegen via a submodule, update this with
git submodule update --remote chaste_codegen/ontologies
.Please note this same way can be used to update the
cellml
inchaste_codegen/data/tests/cellml
submodule if required.create a new branch
git checkout -b <name_of_new_branch>
git add
,git commit
andgit push
the changesmake a pull run the tests and fix any issues that arise
update the release notes
release.txt
with information about the updated ontology.To use the changes with chaste, do a new release of chaste_codegen.
Doing a new chaste_codegen release¶
Update the release version number in
chaste_codegen/version.txt
.Update the release notes
release.txt
with the latest release number.For this version number: minor numbers will be picked up by chaste automatically, for major version numbers,
chaste_codegen.txt
will need updating in the chaste repository.Follow the following tutorial to publish the package: https://packaging.python.org/en/latest/tutorials/packaging-projects/
You will need a login to pypi.org and the account you are using will need access to chaste_codegen.
API documentation¶
chaste_codegen Package¶
Main module for cardiac Chaste code generation
Functions¶
|
|
|
|
|
Loads a template from the local template directory. |
Substitutes the placeholder math functions in expr for their corresponding Sympy functions :param expr: sympy expression |
|
|
Returns the version number, as a 3-part integer (major, minor, revision). |
Classes¶
|
Holds template and information specific for the Backwards Euler model type |
|
Holds information specific for the Optimised Backward Euler model type. |
|
Holds information about a cellml model for which chaste code is to be generated. |
|
Converts Sympy expressions to strings for use in Chaste code generation. |
|
Holds template and information specific for the CVODE model type |
|
Holds template and information specific for the GeneralisedRushLarsen model type |
Holds template and information specific for the GeneralisedRushLarsenOpt model type |
|
|
Holds template and information specific for the GeneralisedRushLarsen model type |
Holds template and information specific for the GeneralisedRushLarsenOpt model type |
|
|
Converts Sympy expressions to strings for use in Chaste code generation. |
|
Holds template and information specific for the Normal model type |
|
Holds information specific for the Optimised model type. |
|
Holds information specific for the Cvode Optimised model type. |
|
|
|
Holds template and information specific for the RushLarsen model type |
|
Holds template and information specific for the RushLarsen model type |
|
Holds template and information specific for the RushLarsen model type |
|
Holds template and information specific for the RushLarsen model type |
|
Handles conversion of MathmL to Sympy exprerssions. |
|
|
|
|
|
|
|
|
|
|
|