Skip to content

Conversation

@ZoeLeibowitz
Copy link
Contributor

@ZoeLeibowitz ZoeLeibowitz commented Jun 9, 2025

A portion of this PR involves code reorganisation and general cleanup.
Key additions:

  • PetscBundle inside petsc/types/array.py
  • Various new types inside petsc/types/types.py to help simplify PETScSolve
  • PetscBundle use inside petsc/iet/routines.py to fix mixed solver functionality
  • A mixed solver test/example - 02_biharmonic.py

@ZoeLeibowitz ZoeLeibowitz added WIP Still work in progress compiler API api (symbolics, types, ...) feature-request labels Jun 9, 2025
@codecov
Copy link

codecov bot commented Jun 11, 2025

Codecov Report

❌ Patch coverage is 31.80760% with 879 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.69%. Comparing base (6b6ad4f) to head (ff4b2d7).
⚠️ Report is 61 commits behind head on petsc.

Files with missing lines Patch % Lines
tests/test_petsc.py 12.69% 330 Missing ⚠️
devito/petsc/iet/routines.py 9.04% 191 Missing ⚠️
devito/petsc/types/types.py 30.31% 177 Missing ⚠️
devito/petsc/logging.py 38.27% 50 Missing ⚠️
devito/petsc/iet/passes.py 27.90% 30 Missing and 1 partial ⚠️
devito/petsc/solve.py 27.77% 26 Missing ⚠️
devito/petsc/types/array.py 54.71% 24 Missing ⚠️
devito/petsc/iet/logging.py 34.28% 23 Missing ⚠️
devito/petsc/iet/utils.py 27.77% 13 Missing ⚠️
devito/operator/profiling.py 68.75% 4 Missing and 1 partial ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##            petsc    #2626      +/-   ##
==========================================
- Coverage   85.39%   84.69%   -0.70%     
==========================================
  Files         261      265       +4     
  Lines       50604    51307     +703     
  Branches     4326     4351      +25     
==========================================
+ Hits        43211    43453     +242     
- Misses       6667     7126     +459     
- Partials      726      728       +2     

☔ 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.

@ZoeLeibowitz ZoeLeibowitz marked this pull request as ready for review June 15, 2025 21:44
# Precedence rules make it possible to reconstruct objects that depend on
# higher priority objects
keys = [Bundle, Array, DiscreteFunction, AbstractIncrDimension, BlockDimension]
keys = [Bundle, Array, Differentiable, DiscreteFunction,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add Differentiable here? Is it possible to add a test to test_iet covering this specific case (or at least for me to understand)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@FabioLuporini The problem arises from my new class PetscBundle(Bundle), whose components are PETScArrays. In the abstract_objects function, the mapper must be updated for the components before the PetscBundle itself. PETScArray inherits from ArrayBasic and Differentiable. However, I can't use ArrayBasic because Bundle also inherits from it. So I chose Differentiable as the distinguishing type (to avoid using PETScArray)

Copy link
Contributor

@EdCaunt EdCaunt left a comment

Choose a reason for hiding this comment

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

Looking good, mainly minor things and code style

"""The interior SubDomain of the Grid."""
return self.subdomains['interior']

@property
Copy link
Contributor

Choose a reason for hiding this comment

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

Cache this I think? Maybe sympy's handling already does though? @FabioLuporini

@ZoeLeibowitz ZoeLeibowitz merged commit 91c91c3 into petsc Jul 30, 2025
31 checks passed
@ZoeLeibowitz ZoeLeibowitz deleted the biharmonic branch November 10, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API api (symbolics, types, ...) compiler feature-request WIP Still work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants