-
-
Notifications
You must be signed in to change notification settings - Fork 553
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
Summary variables calculated only when called #4621
base: develop
Are you sure you want to change the base?
Summary variables calculated only when called #4621
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.21% 99.22%
========================================
Files 302 303 +1
Lines 22858 22950 +92
========================================
+ Hits 22679 22771 +92
Misses 179 179 ☔ View full report in Codecov by Sentry. |
self._possible_variables = model.summary_variables # minus esoh variables | ||
self._esoh_variables = [] # Store eSOH variable names | ||
|
||
# Flag if eSOH calculations are needed |
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.
related: #4619
67542c0
to
b76d866
Compare
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.
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?
self.first_state = None | ||
self.last_state = None | ||
self.cycles = cycle_summary_variables | ||
self.cycle_number = np.arange(1, len(self.cycles) + 1) |
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.
I can see that at least cycle_number
is used outside this class, can you please document the attributes that are meant to be public in the docstring?
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: