PetabSimulationResult for PetabSimulator.simulate#3104
PetabSimulationResult for PetabSimulator.simulate#3104dweindl merged 1 commit intoAMICI-dev:mainfrom
PetabSimulationResult for PetabSimulator.simulate#3104Conversation
72bf975 to
30ec519
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3104 +/- ##
==========================================
- Coverage 78.25% 77.60% -0.66%
==========================================
Files 315 315
Lines 20464 20478 +14
Branches 1500 1500
==========================================
- Hits 16014 15891 -123
- Misses 4441 4578 +137
Partials 9 9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Introduce dataclass `PetabSimulationResult` for `PetabSimulator.simulate` results. I think this will be more convenient: compatible with type annotations, static analysis, and auto-completion. Closes AMICI-dev#3094.
30ec519 to
316939f
Compare
| """ | ||
|
|
||
| #: List of :class:`amici.sim.sundials.ExpData` instances, one per | ||
| #: simulated experiment. These objects may be modified by subsequent |
There was a problem hiding this comment.
Why would these be modified? I was wondering whether it would make sense to have dataclass(frozen=True)
There was a problem hiding this comment.
This depends on how the ExpDatas are handled. For performance/memory reasons, it would be preferable to create them once, and store them in the ExperimentManager, and then only update the parameters when necessary.
We can then either always copy them when creating the PetabSimulationResult (which means we could also just not re-use them in the first place), or we only store the reference here, meaning that after the next simulation, the parameters may have changed.
Ideally, we'd split up ExpData into a parameter-dependent and parameter-independent part to circumvent this problem. That would however be a bigger thing (#3106).
The frozen=True decision is independent and would have only little effect because all current members are mutable. No objections to applying that, though.
There was a problem hiding this comment.
This depends on how the
ExpDatas are handled. For performance/memory reasons, it would be preferable to create them once, and store them in theExperimentManager, and then only update the parameters when necessary. We can then either always copy them when creating thePetabSimulationResult(which means we could also just not re-use them in the first place), or we only store the reference here, meaning that after the next simulation, the parameters may have changed. Ideally, we'd split upExpDatainto a parameter-dependent and parameter-independent part to circumvent this problem. That would however be a bigger thing.The
frozen=Truedecision is independent and would have only little effect because all current members are mutable. No objections to applying that, though.
Oh, I see. Not great, but makes sense.
Introduce dataclass
PetabSimulationResultforPetabSimulator.simulateresults. I think this will be more convenient: compatible with type annotations, static analysis, and auto-completion.Closes #3094.