Skip to content

Conversation

MarcBerliner
Copy link
Member

Description

When the time axis changes scale (e.g., from seconds to hours or days), minor floating-point arithmetic issues at the initial and final times can cause interpolation outside the timespan. As a result, the spatial variables could return NaN at the initial and final time points

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@MarcBerliner MarcBerliner changed the title Fix plotting interpolation bug Fix plotting interpolation bug with spatial variables Feb 12, 2025
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.70%. Comparing base (2803090) to head (5cee466).
Report is 87 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4841   +/-   ##
========================================
  Coverage    98.70%   98.70%           
========================================
  Files          303      303           
  Lines        23328    23335    +7     
========================================
+ Hits         23025    23032    +7     
  Misses         303      303           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kratman kratman merged commit 9ec472d into develop Feb 12, 2025
26 checks passed
@kratman kratman deleted the mdb/fix-plotting-bug branch February 12, 2025 21:37
RohitP2005 pushed a commit to RohitP2005/PyBaMM that referenced this pull request Feb 13, 2025
* fix plotting interpolation bug

* Update CHANGELOG.md
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.

3 participants