Skip to content

Fix standalone execution of four advanced utility examples - #1187

Open
ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:fix/advanced-utility-runtime-examples
Open

ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:fix/advanced-utility-runtime-examples

Conversation

@ss2098

@ss2098 ss2098 commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix four advanced Underworld3 utility examples that previously failed during standalone execution.

Corrections

Ex_Anisotropy.py

  • Import IPython's display function for standalone execution.
  • Use raw strings for LaTeX-style symbolic names to avoid Python invalid-escape warnings.

Ex_Darcy_1D_benchmark.py

  • Flatten evaluated pressure arrays before plotting.
  • Correct the NumPy shape incompatibility with Matplotlib.

Ex_Darcy_3D_flow_x_axis.py

  • Correct both scalar pressure plotting arrays.
  • Create the checkpoint output directory before writing simulation results.

Ex_Darcy_3D_flow_z_axis.py

  • Correct both scalar pressure plotting arrays.
  • Create the checkpoint output directory before writing simulation results.

Validation

All four complete examples were executed individually using the existing Underworld3 Pixi Python environment on macOS arm64 with PETSc 3.25.3.

PR creation was gated on:

  • Successful Python compilation.
  • Zero process exit codes.
  • No detected Python tracebacks, PETSc errors, MPI aborts, or ignored cleanup exceptions.
  • Git whitespace validation.
  • Exactly four intended source files staged.

Scope

These changes concern example execution and output-directory handling.

No Underworld3 solver-core, PETSc, MPI, or packaging implementation is modified.

The audit also identified issues in other advanced examples, including obsolete visualization APIs, optional dependencies, incomplete symbolic code, and unavailable MMG support. Those examples are excluded pending independent validation.

The tests establish successful single-process execution, not numerical convergence or multi-rank behavior.

@ss2098
ss2098 requested a review from lmoresi as a code owner November 14, 2026 02:35

This branch has not been deployed

No deployments
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.

1 participant