Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Chaste model export #3

Closed
28 tasks done
MichaelClerx opened this issue Dec 2, 2018 · 8 comments · Fixed by #196
Closed
28 tasks done

Implement Chaste model export #3

MichaelClerx opened this issue Dec 2, 2018 · 8 comments · Fixed by #196
Assignees

Comments

@MichaelClerx
Copy link
Collaborator

MichaelClerx commented Dec 2, 2018

To do

  • Add simple template for .hpp files normal models (default vector type std::vector<double>)
  • Write test that comapres generated .hpp against a PyCml generated reference
  • Add simple template for .cpp files normal models
  • Write test that compares generated .cpp against a PyCml generated reference (new tests added together with new features)
  • Add C++ expression printer, based on WebLabPrinter
  • Add GetIIonic method (a subset of ComputeDerivedQuantities used in tissue simulations) there is some fancy business working out what currents are relevant (right hand side of dV/dt equation).
  • Use Chaste units - voltage in mV, time in ms, current as per https://chaste.cs.ox.ac.uk/trac/wiki/ChasteGuides/ChasteUnits, Ca_i
  • Repeat above for Cvode cells - Numerical Jacobian (N_Vector). Option -t CVODE; class CellMLToCvodeTranslator.
  • Repeat above for Cvode cells with Analytic Jacobian. Options -t CVODE, -j.
    • Jacobian calculation in cellmlmanip (done in pycml with -J using Maple) using sympy
  • Repeat above for Opt models: re-implement lookup tables. Options -l and optimize.py.
    • Implemented a version of partial evaluation as a separate phase for now.
    • Lookup tables
  • Repeat above for Backwards Euler models. (use a special Jacobian related to the one above with Identity matrix minus delta_t*one above). Options -t Chaste, -j, --backward-euler.
  • Add ComputeDerivedQuantities method - should be similar in implementation to WebLab GetOutputs.
  • Add Rush-Larsen cells (requires gating variables with exact solution over fixed V to be identified, with tags or - even better - by analysing the equations). Option --rush-larsen.
  • Add Generalised Rush Larsen cells (see TestPyCmlLongGeneralisedRushLarsenFirstOrder).
  • Add Generalised Rush Larsen second order cells (see TestPyCmlLongGeneralisedRushSecondOrder).
  • Look at compiling on the fly ("dynamically loaded") by using new Python 3 code instead of PyCML). Option -y.
  • Other specialist cell types - DataClamp (--use-data-clamp)
  • Other specialist cell types - WithModifiers (--use-modifiers)
  • Complex unit conversion rules via cellmlmanip
  • Use ontology to tag currents (besides stimulu_current)
  • Fix sympy1.6 warnings and other warnings as much as possible
  • Update github documentation (especially command line instructions etc.)
  • Packaging chaste_codegen to enable districution
  • Setting up cmake/make system to use chaste_codegen
  • PyCML replacement ready for Python 3 (note on https://chaste.cs.ox.ac.uk/trac/ticket/2991)
  • Deal with and fix singularities in equations
@mirams
Copy link
Collaborator

mirams commented Dec 2, 2018

I don't think this is something you should distract yourself with at the moment (although nice to have in the back of your mind when working on cellmlmanip).

In fact I thought it would be a nice introductory task to leave for new Nottingham RSE to get up to speed with Chaste and Web Lab tools?

@mirams
Copy link
Collaborator

mirams commented Aug 14, 2019

I've updated the checklist with a suggested order

@jonc125
Copy link
Contributor

jonc125 commented Aug 16, 2019

I've updated the checklist with a suggested order

So backward Euler is more important than data clamp & modifiers?

@mirams
Copy link
Collaborator

mirams commented Aug 16, 2019

Probably, not sure anyone is using any of them very much, but seems a pity to loose capabilities. The modifiers were supposed to be replaced with functional curation + WL anyway

@jonc125
Copy link
Contributor

jonc125 commented Aug 16, 2019

Testing for this issue will be trickier than with the Web Lab code-gen, because you can't run simulations without Chaste available. So possibly tests within this repo should just compare the generated code against reference versions created by pycml, at least initially?

@MauriceHendrix
Copy link
Contributor

Testing for this issue will be trickier than with the Web Lab code-gen, because you can't run simulations without Chaste available. So possibly tests within this repo should just compare the generated code against reference versions created by pycml, at least initially?

That was my thinking indeed, as otherwise we'd also need both python 2 and 3 as well as the obsolute libs we're trying to get away from.

@MauriceHendrix
Copy link
Contributor

first release:
https://pypi.org/project/chaste-codegen/
still to do: the link up with the chaste build system & python3 translation of other python bits

@MauriceHendrix
Copy link
Contributor

I reopened this because:

  • it is easier to find this way and can be useful for reference
  • we're working on dealing with singularities in equations

@MauriceHendrix MauriceHendrix reopened this Feb 4, 2021
@MauriceHendrix MauriceHendrix linked a pull request Feb 4, 2021 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants