-
Notifications
You must be signed in to change notification settings - Fork 32
PetabSimulationResult for PetabSimulator.simulate
#3104
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
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
Introduce dataclass
PetabSimulationResultforPetabSimulator.simulateresults. I think this will be more convenient: compatible with type annotations, static analysis, and auto-completion.Closes #3094.