Refactors BaseCost.evaluate/S1 into BaseCost.compute#455
Conversation
…uate/S1 into __call__
…mple stoich., tidy GaussLikelihood
…emove redundant return calcs
…lf), GaussianLogLikelihood now separable, updt tests.
…hods-to-accept-precomputed-signals # Conflicts: # CHANGELOG.md
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #455 +/- ##
===========================================
- Coverage 98.71% 98.69% -0.02%
===========================================
Files 47 47
Lines 3025 2985 -40
===========================================
- Hits 2986 2946 -40
Misses 39 39 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
…hods-to-accept-precomputed-signals # Conflicts: # CHANGELOG.md
…hods-to-accept-precomputed-signals # Conflicts: # CHANGELOG.md # tests/integration/test_spm_parameterisations.py
|
Project coverage fails because this PR removes a large amount of code, but the number of missed line hits remains the same. All good for review. |
NicolaCourtier
left a comment
There was a problem hiding this comment.
I'm going to remove the inputs argument from compute() to avoid the possibility of users passing parameters which do not match those used to make the prediction. Other than that, only a couple of minor comments and we should be good to merge.
NicolaCourtier
left a comment
There was a problem hiding this comment.
Thanks for these improvements!
Description
This PR refactors
BaseCost.evaluate/S1&BaseCost._evaluate/S1intoBaseCost.__call__andBaseCost.compute.BaseCost.computedirectly acts on the predictions, whileBaseCost.__call__callsBaseProblem.evaluate/S1beforeBaseCost.compute. Fully separates__call__andcomputefor FittingCosts, Likelihoods. This PR also has bugfixes to GaussianLogLikelihood calculation.Issue reference
Fixes #435
Review
Before you mark your PR as ready for review, please ensure that you've considered the following:
Type of change
Key checklist:
$ pre-commit run(or$ nox -s pre-commit) (see CONTRIBUTING.md for how to set this up to run automatically when committing locally, in just two lines of code)$ nox -s tests$ nox -s doctestYou can run integration tests, unit tests, and doctests together at once, using
$ nox -s quick.Further checks:
Thank you for contributing to our project! Your efforts help us to deliver great software.