Skip to content

Commit

Permalink
fixing appredict error (#240)
Browse files Browse the repository at this point in the history
* fixing appredict error
  • Loading branch information
MauriceHendrix committed Apr 21, 2022
1 parent 2c4f4bb commit e401d52
Show file tree
Hide file tree
Showing 49 changed files with 4,568 additions and 6,525 deletions.
6 changes: 3 additions & 3 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Release 0.9.8
# Release 0.9.9
- Fixed an issue with unused variables appearing in common terms in jacobians.
- Fixes a bug printing large integers, in some environments: Large numbers such as 8.034023767017109e+27 whch were actually ints would be printed as an the int 8034023767017108950029959168 and then the C++ compiler would complain as that's more than the maximum int value. This has been fixed by only printing ints as ints if they are `MIN_INT < number < MAX_INT` else we print them as a float (and we get the sceintific notation).
- Fixed tests to pass with sympy 1.10 and required latest cellmlmanip, which also workes with sympy1.10. Updated sympy requirement to be >=1.9, < 1.11
- Fixes a bug printing large integers, in some environments: Large numbers such as 8.034023767017109e+27 which were actually ints would be printed as an the int 8034023767017108950029959168 and then the C++ compiler would complain as that's more than the maximum int value. This has been fixed by only printing ints as ints if they are `MIN_INT < number < MAX_INT` else we print them as a float (and we get the sceintific notation).
- Fixed tests to pass with sympy 1.10 and required latest cellmlmanip, which also works with sympy1.10. Updated sympy requirement to be >=1.9, < 1.11

# Release 0.9.5
- Corrected a type in the generated output for `--rush-larsen-c`
Expand Down
5 changes: 0 additions & 5 deletions chaste_codegen/_partial_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
Float,
Piecewise,
cse,
exp,
piecewise_fold,
)
from sympy.core import Symbol

from chaste_codegen._math_functions import exp_


def get_usage_count(equations):
"""Counts the amount of times the lhs for each eq is used on the rhs in the set of equations following it.
Expand All @@ -36,12 +33,10 @@ def fold_piecewises(expr):
# Since piecewise_fold hangs with some complicated nestings, due to simplification we use the following workaround:
# First extract common terms, perform piecewise_fold, re-insert the common terms
# see: https://github.com/sympy/sympy/issues/20850
expr = expr.replace(exp, exp_)
common_terms, expr = cse(expr)
expr = piecewise_fold(expr[0])
for term, ex in reversed(common_terms):
expr = expr.xreplace({term: ex})
expr = expr.replace(exp_, exp)
return expr


Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

276 changes: 140 additions & 136 deletions chaste_codegen/data/tests/chaste_reference_models/BE/li_mouse_2010.cpp

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e401d52

Please sign in to comment.