PySCeS / pysces

The official PySCeS project source code repository.
https://pysces.github.io
Other
34 stars 10 forks source link

Example models for RateRules #76

Closed jmrohwer closed 2 years ago

jmrohwer commented 2 years ago

There was a bug in the way Rate Rules were handled with the new Assimulo CVODE implementation. Picked this up with the Surovtsev whole cell model surovtsev.psc.

Fixed in 9de93047321353df49a69414fe9c7a3ab527c8a3, the model now executes successfully, but I am not sure if the numbers are correct.

@bgoli are you aware of other modules with Rate Rules (preferably with validated output), which we could use to test this before releasing a bugfix?

bgoli commented 2 years ago

The SBML test-suite will have some, I'll take a look. I also have the scripts and figures (unfortunately no numerical data) of some simulations and parameter scans that I made with that model in 2008 if that helps?

jmrohwer commented 2 years ago

Yes I have seen the SBML test suite and am busy investigating that. BTW have you ever written a PySCeS wrapper for the SBML test runner? If not, I could look into that, it would be quite useful.

If you have scripts and figures for that specific model, please share. I would be mainly interested in simulations, as I need to check the CVODE implementation.

bgoli commented 2 years ago

I had a wrapper at some point, I'll see if I can find it.

jmrohwer commented 2 years ago

Busy cleaning up the CVODE code. @bgoli is there any need for the mod.CVODE_extra_output? As far as I can see, it is only used for "monitoring" certain derived functions, such as implemented in the whole cell model with forcing functions/assignment rules. This can just as easily be calculated after the simulation by accessing the mod.data_sim class, which has all the info (or the mod.sim RecArray for direct calling per attribute).

This was easy to do in the previous CVODE implementation with PySundials where we looped through every time point in a for loop and could add code hooks. The new implementation though instantiates the CVode() class from Assimulo and just returns an array of the final results. I suppose I could hack something together but IMO it is not worth it. Or is there another use case I am missing?

jmrohwer commented 2 years ago

Busy cleaning up the CVODE code. @bgoli is there any need for the mod.CVODE_extra_output? As far as I can see, it is only used for "monitoring" certain derived functions, such as implemented in the whole cell model with forcing functions/assignment rules. This can just as easily be calculated after the simulation by accessing the mod.data_sim class, which has all the info (or the mod.sim RecArray for direct calling per attribute).

This was easy to do in the previous CVODE implementation with PySundials where we looped through every time point in a for loop and could add code hooks. The new implementation though instantiates the CVode() class from Assimulo and just returns an array of the final results. I suppose I could hack something together but IMO it is not worth it. Or is there another use case I am missing?

Implemented in 8ebbcb3

jmrohwer commented 2 years ago

I have written a PySCeS Wrapper for the SBML Test Runner, and checked the RateRule implementation. This now runs without error against test models. I am closing this issue and have opened a PR #77 to merge the changes into main and draft a bugfix 1.0.2 release.