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

Adds additional tests for Casadi modes #4028

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

BradyPlanden
Copy link
Member

Description

This PR adds additional tests for the Casadi modes: "safe", "fast", "fast with events" with asserts comparing the results from each mode on an SPM.

Fixes #4027

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

codecov bot commented Apr 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.57%. Comparing base (d68a958) to head (0e3cd86).

Current head 0e3cd86 differs from pull request most recent head 4d4b014

Please upload reports for the commit 4d4b014 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4028      +/-   ##
===========================================
- Coverage    99.58%   99.57%   -0.01%     
===========================================
  Files          288      260      -28     
  Lines        21789    21358     -431     
===========================================
- Hits         21698    21267     -431     
  Misses          91       91              

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

@agriyakhetarpal
Copy link
Member

agriyakhetarpal commented Apr 21, 2024

The notebook that timed out (loss_of_active_materials.ipynb) in the notebook tests has been doing so much more frequently recently, I just triggered a re-run (twice) and it still fails. It's not entirely clear from the logs which code cell is timing out and I don't see it happening when I try locally. Maybe we should ignore the pip install cells in the notebooks from execution (https://github.com/treebeardtech/nbmake#ignore-a-code-cell)? We can also increase the timeout for cell execution, but it's set to 5 minutes already and that should be enough time to run an entire notebook, let alone a cell.

Copy link
Contributor

@martinjrobins martinjrobins left a comment

Choose a reason for hiding this comment

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

as I understand it this is not testing anything new, just testing the different solver modes with the SPM model instead of toy models? If so I think it should probably live in the integration tests (e.g. in https://github.com/pybamm-team/PyBaMM/tree/develop/tests/integration/test_solvers)

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.

Additional tests for Casadi modes
4 participants