Summary variables calculated only when called#4621
Merged
martinjrobins merged 18 commits intoDec 19, 2024
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4621 +/- ##
===========================================
+ Coverage 99.09% 99.22% +0.12%
===========================================
Files 302 303 +1
Lines 22992 22955 -37
===========================================
- Hits 22783 22776 -7
+ Misses 209 179 -30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rtimms
reviewed
Nov 28, 2024
| self._possible_variables = model.summary_variables # minus esoh variables | ||
| self._esoh_variables = [] # Store eSOH variable names | ||
|
|
||
| # Flag if eSOH calculations are needed |
67542c0 to
b76d866
Compare
martinjrobins
requested changes
Dec 9, 2024
martinjrobins
left a comment
Contributor
There was a problem hiding this comment.
sorry for the delay in the review! This looks great, can you please add to the CHANGELOG under breaking changes, since this changes the api for the summary variables?
martinjrobins
approved these changes
Dec 19, 2024
martinjrobins
left a comment
Contributor
There was a problem hiding this comment.
looks good, thanks @pipliggins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Rather than calculating summary variables and storing them in every Solution class, a 'SummaryVariables' class is created which stores the first + last state of the solution, plus any relevant esoh parameters, so that the summary variables are only calculated and stored when they are called (similar to accessing standard variables). If an esoh variable is requested, they are all calculated and stored at once to reduce the number of calls to the esoh solver.
rather than viewing the list of summary variable names as
you can now use
to view the names without calculating the variables.
Similarly, when plotting rather than getting the number of cycles as
they are accessed as
Fixes #4058
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)$ python run-tests.py --all(or$ nox -s tests)$ python run-tests.py --doctest(or$ nox -s doctests)You can run integration tests, unit tests, and doctests together at once, using
$ python run-tests.py --quick(or$ nox -s quick).Further checks: