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

Fix bug with identical steps with different end times #3516

Merged
merged 8 commits into from
Nov 16, 2023
Merged

Conversation

brosaplanella
Copy link
Sponsor Member

Description

Fixes a bug in which identical steps but with different end times could not be distinguished, and thus crashed the simulation by using a wrong end time.

It is a hacky fix, a more robust one should be implemented as part of the refactor in #3176.

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

Copy link
Member

@valentinsulzer valentinsulzer 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 to me

@brosaplanella
Copy link
Sponsor Member Author

Should we hold this until the next release? I am not sure what would be best.

@valentinsulzer
Copy link
Member

All code that goes into develop now is held off until the next release, except critical bug fixes, at least that is how it should be ...

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6fbd306) 99.58% compared to head (0598541) 99.58%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3516   +/-   ##
========================================
  Coverage    99.58%   99.58%           
========================================
  Files          256      256           
  Lines        20116    20117    +1     
========================================
+ Hits         20033    20034    +1     
  Misses          83       83           

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

@brosaplanella brosaplanella merged commit 7c15368 into develop Nov 16, 2023
25 of 35 checks passed
@brosaplanella brosaplanella deleted the debug-UP2 branch November 16, 2023 11:08
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this pull request Aug 12, 2024
* fix bug with identical steps with different end times

* add copy method for steps

* undo testing changes

* fix failing tests

* update CHANGELOG

* remove copy method as it is unused

* remove raw termination as unused
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