Skip to content

Less xreplace - #276

Merged
finsberg merged 2 commits into
ode2cellmlfrom
less-xreplace
Aug 12, 2026
Merged

Less xreplace#276
finsberg merged 2 commits into
ode2cellmlfrom
less-xreplace

Conversation

@finsberg

@finsberg finsberg commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Carry over more of the underlying expression. Until now for example the expression

(v - 4.823)/51.12

will silently be turned into

0.0195618153364632*v - 0.0943466353677621

Now, the full expression is carried through the code generation which will hopefully improve the precision.
This is achieved using the context manager

with sp.core.parameters.evaluate(False):
     ....

when using xreplace.

Also remove expressions such as *1.0 and /1.0

@finsberg
finsberg merged commit 5b01107 into ode2cellml Aug 12, 2026
23 checks passed
@codspeed-hq

codspeed-hq Bot commented Aug 12, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 8 untouched benchmarks


Comparing less-xreplace (479bf95) with ode2cellml (2eed77a)1

Open in CodSpeed

Footnotes

  1. No successful run was found on ode2cellml (479bf95) during the generation of this report, so 87644fa was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

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 this pull request may close these issues.

1 participant