SciML / CellMLToolkit.jl

CellMLToolkit.jl is a Julia library that connects CellML models to the Scientific Julia ecosystem.
https://docs.sciml.ai/CellMLToolkit/stable/
Other
62 stars 15 forks source link

Set known defaults for a `CellModel`s `ODESystem` #100

Closed bauglir closed 1 year ago

bauglir commented 1 year ago

CellML files contain initial_value fields specifying initial values for parameters and states in the system. Retrieving these for the ODESystem was already possible, but had to be done separately or as part of the ODEProblem constructor defined for CellModels. This change makes sure they're added as defaults of the ODESystem instead simplifying code that's consuming these ODESystems.

Defaults are only set for simplified ODESystems. Unsimplified ODESystems may contain parameters and states for which no defaults are available resulting in errors trying to construct the ODESystem. These errors will still occur when using the result of calling process_components with simplify = false, but as noted in the code that should only be done for debugging purposes and this functionality is not exposed at the higher API levels.

Fixes #56.

codecov[bot] commented 1 year ago

Codecov Report

Merging #100 (3ecae1c) into master (a879de9) will increase coverage by 0.04%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
+ Coverage   83.66%   83.70%   +0.04%     
==========================================
  Files           6        6              
  Lines         355      356       +1     
==========================================
+ Hits          297      298       +1     
  Misses         58       58              
Impacted Files Coverage Δ
src/components.jl 93.33% <100.00%> (+0.04%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

anandijain commented 1 year ago

awesome, thanks joris