Skip to content
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

Improve memory use in experiments #3261

Merged
merged 18 commits into from
Sep 19, 2023

Conversation

brosaplanella
Copy link
Sponsor Member

@brosaplanella brosaplanella commented Aug 10, 2023

Description

Improve memory use in experiments by redefining what steps are unique. Two steps are considered the same if type, value, termination and temperature are the same, as these are the variables used when processing the model. The remaining variables are only used when running the model and can be passed as inputs. I have also defined a basic_repr which returns a representation with only those variables, while __repr__ returns a representation with all the variables.

Fixes #3081

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist:

  • No style issues: $ 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)
  • All tests pass: $ python run-tests.py --all (or $ nox -s tests)
  • The documentation builds: $ 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:

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (6622ec6) 99.55% compared to head (cdc6d83) 99.55%.
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3261   +/-   ##
========================================
  Coverage    99.55%   99.55%           
========================================
  Files          253      253           
  Lines        19553    19558    +5     
========================================
+ Hits         19466    19471    +5     
  Misses          87       87           
Files Changed Coverage Δ
pybamm/solvers/solution.py 100.00% <ø> (ø)
pybamm/experiment/experiment.py 100.00% <100.00%> (ø)
pybamm/simulation.py 100.00% <100.00%> (ø)
pybamm/step/_steps_util.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@rtimms rtimms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @brosaplanella looks good to me!

pybamm/solvers/solution.py Outdated Show resolved Hide resolved
@brosaplanella brosaplanella merged commit da22c3d into develop Sep 19, 2023
33 of 34 checks passed
@brosaplanella brosaplanella deleted the issue-3081-improve-memory-experiments branch September 19, 2023 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve memory usage for experiments with start_time
2 participants