ModellingWebLab / cellmlmanip

CellML loading and model equation manipulation
Other
3 stars 1 forks source link

Support for secondary trig functions #314

Closed MichaelClerx closed 4 years ago

MichaelClerx commented 4 years ago

Description

Cellmlmanip had partial support for secondary trig functions (sec, csc, cot, and their inverse and hyperbolic functions). This PR adds tests for the cellml-to-sympy transpiler and adds methods to the printer to write expressions to evaluate them (using python's math module, which doesn't have these expressions natively)

Types of changes

Documentation checklist

Testing

codecov[bot] commented 4 years ago

Codecov Report

Merging #314 into develop will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop      #314   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines         1361      1369    +8     
  Branches       298       300    +2     
=========================================
+ Hits          1361      1369    +8     
Impacted Files Coverage Δ
cellmlmanip/printer.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 968715b...754945f. Read the comment docs.

MichaelClerx commented 4 years ago

Yeah I'd be very surprised if any of these show up in cardiac cell models. I can think of one with a tanh function, and one with an acos, but that's pretty much it as far as trig functions are concerned

MichaelClerx commented 4 years ago

They are part of CellML though (for the stupidest reason: "it was easy to implement in C". I tried to reduce the number of trig functions a bit for CellML 2 but nobody else wanted too)

MauriceHendrix commented 4 years ago

ok fair enough, so we should probably have them in chaste_codegen