Deprecate pybamm.Magnitude in favour of Component - #5691
Open
aabills wants to merge 8 commits into
Open
Conversation
Support 3D vector fields via N-component VectorField, Component/Norm operators, and matching discretisation/solution handling. Extracted from the unstructured finite-volume work for review in isolation. Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce UnstructuredSubMesh, mesh generators, and Mesh interface coupling so arbitrary 2D/3D domains can be discretised later. Extracted from the unstructured finite-volume stack for isolated review. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # CHANGELOG.md
Add FiniteVolumeUnstructured, discretisation hooks, and unstructured processed variables so cell-centered solutions can be formed on the new meshes. Extracted from the unstructured finite-volume stack. Co-authored-by: Cursor <cursoragent@cursor.com>
Add VTKQuickPlot, QuickPlot/dynamic_plot hooks, the vtk optional extra, and headless OSMesa CI setup for GIF export. Extracted from the unstructured finite-volume stack. Co-authored-by: Cursor <cursoragent@cursor.com>
Add BasicDFN2DUnstructured and BasicDFN3DUnstructured on top of the meshing, spatial-method, and plotting stack, plus Max/Min reduction and domain-size helpers needed by those models. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Emit DeprecationWarning from Magnitude and migrate internal 2D call sites to Component. Teach FiniteVolume2D edge-averaging to read Component indices so the replacement works for flux products. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Jul 31, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ufv-4-models #5691 +/- ##
=============================================
Coverage 96.84% 96.84%
=============================================
Files 344 344
Lines 34489 34499 +10
=============================================
+ Hits 33402 33412 +10
Misses 1087 1087 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
rtimms
approved these changes
Aug 3, 2026
aabills
force-pushed
the
ufv-4-models
branch
2 times, most recently
from
September 5, 2026 00:28
240b105 to
b6dcc1a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pybamm.Magnitudewith aDeprecationWarningpointing users topybamm.Component(symbol, 0|1).BasicDFN2D, 2D FV / processed-variable tests) toComponent.FiniteVolume2Dedge-averaging to acceptComponentindices so the replacement works for flux products.Stack
MagnitudeTest plan
test_vector_field_and_magnitude.py(Component + deprecation)test_process_binary_operators,test_processed_variable_2D_fvm, 2D integration tests