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

Issue 2040 events #2212

Merged
merged 16 commits into from
Sep 6, 2022
Merged

Issue 2040 events #2212

merged 16 commits into from
Sep 6, 2022

Conversation

valentinsulzer
Copy link
Member

Description

Raises a SolverError if the initial conditions trigger the events. This requires the events to always be written in a way that they are positive initially, and should be triggered when they become negative.

In an experiment, if an "[experiment]" event is triggered, then the step is just skipped (returns EmptySolution) without raising an error. This is to deal with cases such as "Charge at 1C until 4.2V" when we start from full SOC.

Fixes #2040

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: $ flake8
  • All tests pass: $ python run-tests.py --unit
  • The documentation builds: $ cd docs and then $ make clean; make html

You can run all three at once, using $ python run-tests.py --quick.

Further checks:

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

@valentinsulzer valentinsulzer marked this pull request as draft August 3, 2022 13:51
@valentinsulzer valentinsulzer changed the base branch from develop to clean-up-base-solver August 29, 2022 07:39
@valentinsulzer valentinsulzer changed the base branch from clean-up-base-solver to develop August 29, 2022 07:40
@valentinsulzer valentinsulzer changed the base branch from develop to clean-up-base-solver August 29, 2022 07:40
@valentinsulzer valentinsulzer changed the base branch from clean-up-base-solver to develop September 2, 2022 14:06
@codecov
Copy link

codecov bot commented Sep 4, 2022

Codecov Report

Merging #2212 (824f968) into develop (f550813) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #2212   +/-   ##
========================================
  Coverage    99.39%   99.40%           
========================================
  Files          364      364           
  Lines        19930    20007   +77     
========================================
+ Hits         19810    19887   +77     
  Misses         120      120           
Impacted Files Coverage Δ
...m/models/full_battery_models/base_battery_model.py 99.78% <ø> (ø)
...models/full_battery_models/lead_acid/basic_full.py 100.00% <ø> (ø)
...odels/full_battery_models/lithium_ion/basic_dfn.py 100.00% <ø> (ø)
..._battery_models/lithium_ion/basic_dfn_half_cell.py 99.01% <ø> (ø)
...odels/full_battery_models/lithium_ion/basic_spm.py 100.00% <ø> (ø)
.../submodels/particle_mechanics/crack_propagation.py 100.00% <ø> (ø)
pybamm/models/submodels/porosity/base_porosity.py 100.00% <ø> (ø)
pybamm/__init__.py 100.00% <100.00%> (ø)
pybamm/expression_tree/exceptions.py 100.00% <100.00%> (ø)
pybamm/simulation.py 98.86% <100.00%> (+0.02%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@valentinsulzer valentinsulzer marked this pull request as ready for review September 5, 2022 00:34
Copy link
Sponsor Member

@brosaplanella brosaplanella left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

CHANGELOG.md Outdated Show resolved Hide resolved
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.

None yet

2 participants