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

bug in SBMLTransforms::replaceFD? #299

Closed
lkeegan opened this issue Mar 3, 2023 · 2 comments
Closed

bug in SBMLTransforms::replaceFD? #299

lkeegan opened this issue Mar 3, 2023 · 2 comments

Comments

@lkeegan
Copy link
Contributor

lkeegan commented Mar 3, 2023

I was using SBMLTransforms::replaceFD to expand/inline functions in math expressions but ran into incorrect results in some cases:

spatial-model-editor/spatial-model-editor#856 (comment)

I think substituting each argument sequentially like this is only valid if there is no overlap between the variables in the function body and the variables that are passed to the function?

lkeegan added a commit to lkeegan/libsbml that referenced this issue Mar 3, 2023
@fbergmann
Copy link
Member

This has now been fixed and merged into development. We plan to have a new release including the fix within the next couple of weeks.

@lkeegan
Copy link
Contributor Author

lkeegan commented Mar 14, 2023

@fbergmann thanks! Unfortunately while this fixes the failing test case I don't think it is correct in general, e.g. changing the expression from p * S1 to p - S1 gives incorrect results. I think to do the substitution correctly it needs to be done for all variables at the same time - I've made a PR with an attempt at doing this here: #303

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

No branches or pull requests

2 participants