Skip to content

Conversation

@lmoresi
Copy link
Member

@lmoresi lmoresi commented Nov 18, 2025

The full release of UW3 should be at 3.0 ... when we do this, I would like to introduce some new coding patterns that are more conducive to the having and AI-bot (AI-Bat ?) give advice.

So that means there is a lot to review in here.

lmoresi and others added 30 commits August 8, 2025 20:45
Wrapper function for the access manager to improve usability
Minor deetails.
Attempting to fix up the evaluation to be internally consistent, adding the wrappers for the access manager (and calling it `array` for now).

Fix up tests to account for changes to evaluation array sizes on return (mostly squeezes)

Fix a couple of other evaluation bugs (like the need to add a zero vector to some nearly-constant matrices).

Repairing the quickstart guide here and there.
Fix for the first comment by @jcgraciosa.

Also needed to update the JIT code to understand the MATRIX variable type and removing the other types that are (currently) not used. These cause compilation errors if they are lit up by mistake (even if that variable is not in any expression).

Solvers: Navier Stokes / Advection-Diffusion - fix the projection terms and how they pack up their data.
Adding global evaluation routines to compute values anywhere in the distributed domain (also with extrapolation using rbf)
Fixing broken test (array shape)
Not setting initial rank - this has problems when the particle is located on the correct rank because it automatically, always gets migrated to rank 0 and we start hunting for it again (but always in the wrong place).
Missed one !
Nodal Point Swarm also had the issue of uninitialised rank. This causes particles on rank > 1 to be migrated to rank 0 on the first call to migrate. They then get lost ...

Potential fix @jcgraciosa but maybe not the only issue here.
Fixing lack of rank initialisation in swarm.populate.

Also: some changes to the derivative expressions code:
  - .where relevant sym returns the inner expression derived by the diff_variable inner expression in symbolic form (which is closer to the intent of .sym) and does not return the evaluated form.
  - .doit function returns the evaluated form (so this is like the sympy deferred derivative).
This code is *probably* no longer needed
And leaving NodalPointPICSwarm alone
Shortening some monster-sized files.
Imports etc should not change
…t in a more user friendly form attached to the swarm
lmoresi and others added 30 commits December 16, 2025 20:02
Phase 2 of pixi build system migration - adds support for custom PETSc
with adaptive mesh refinement tools (pragmatic, mmg, parmmg, slepc).

New structure:
- petsc-custom/build-petsc.sh: Build script for custom PETSc (~1 hour)
- petsc-custom/README.md: Documentation for AMR build process

Environment tiers (cleaner naming):
- default/amr: Minimal - just build and run underworld3
- runtime/amr-runtime: Run tutorials - adds viz, jupyter
- dev/amr-dev: Development - adds claude, linting, etc.

Two PETSc tracks:
- conda-forge (default): Quick 5-min install, no AMR tools
- custom (amr): Hour-long build with pragmatic, mmg, parmmg

Usage:
  pixi install -e runtime          # Most users
  pixi install -e amr              # AMR researchers
  pixi run -e amr petsc-build      # Build custom PETSc

Both tracks coexist - switch by rebuilding underworld3 in target env.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The wrapper provides a git-friendly way to manage pixi environments:
- Environment choice stored in .pixi-env (git-ignored)
- pixi.toml stays unchanged (no merge conflicts)

Features:
- ./uw status: Show current config and installation state
- ./uw setup: Interactive wizard for first-time configuration
- ./uw --help: Comprehensive reference documentation
- ./uw <cmd>: Passes commands to pixi with configured environment

Also adds petsc4py-install task for installing petsc4py into
different AMR environments after the initial build.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- ./uw now shows brief status + offers setup if unconfigured
- Removed verbose status command (was slow and complex)
- Changed test to run level 1 by default (~2 min)
- Added test-all for running all test levels
- Cleaned up wrapper code (removed unused colors, simplified logic)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Change test defaults to simpler/faster options for development:
- Isolation: OFF by default, use --isolation to enable
- Parallel: OFF by default, use --parallel to enable

Old flags (--no-isolation, --no-parallel) removed.
New flags: --parallel, --parallel-ranks N, --isolation

This makes quick feedback the default, with explicit opt-in
for more thorough testing modes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Show that test options (--isolation, --parallel, levels) pass
through to the test script, with practical examples.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename petsc-build → petsc-local-build (clearer naming)
- Remove petsc4py-install (redundant, petsc-local-build includes it)
- Remove petsc-configure (rarely needed, use script directly)
- Keep petsc-local-clean for convenience

The full build already includes petsc4py, so a separate install
task was unnecessary complexity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Setup is the natural first point of contact for users.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Previously showed "runtime" then "(not configured)" which was confusing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Show pixi environment name for VS Code / IDE kernel config
- Warn minimal environments don't include Jupyter

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Enables Jupyter notebooks to use pixi environments as kernels
in VS Code, JupyterLab, and other IDEs.

Included in: runtime, dev, amr-runtime, amr-dev

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
pixi-kernel checks the default environment even when using other
environments, so ipykernel must be present in all environments
for the kernel to work.

Now all environments support IDE Jupyter kernels (VS Code, etc).
Runtime environments additionally include JupyterLab.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
If pixi is not found, ./uw and ./uw setup will offer to install it
using the official installer from pixi.sh.

This makes the first-time experience smoother:
1. Clone repo
2. Run ./uw
3. Pixi gets installed if needed
4. Setup wizard continues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Displays a table of all environments showing:
- ● active (green) - currently selected and installed
- ● selected (yellow) - selected but not yet installed
- ready - installed but not selected
- ─ - not installed

Helps users see what's available at a glance.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use * for selected environment (not color)
- Show [✓] when underworld3 is built in that environment
- Show [ ] when env installed but uw3 needs building
- Show ─── when environment not installed

Works in all terminals regardless of color support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace conda/mamba instructions with the new ./uw workflow:
- Three-line quick install (clone, cd, ./uw setup)
- Environment options table
- Common commands reference
- Link to detailed docs for manual installation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Explain the two setup questions (AMR? Features?) and when each
environment is appropriate:
- runtime: most users, tutorials
- default: HPC production
- dev: contributors
- amr-*: adaptive mesh research

No emojis.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Point users to ./uw jupyter lab as the first thing to try,
and direct them to docs/beginner/tutorials/Notebook_Index.ipynb

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use: ./uw jupyter lab docs/beginner/tutorials/Notebook_Index.ipynb
Opens JupyterLab directly to the tutorial index.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
VTK 9.5.1 from conda-forge was missing vtkCapsuleSource.
Pin to VTK >=9.5.2 and PyVista >=0.46 which work together.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PyVista 0.46 no longer allows adding arbitrary attributes to mesh
objects. Changed .units and .coord_array to ._units and ._coord_array
(private attributes) which are still allowed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add UWexpression.rename() method for custom display names in multi-material models
- Implement SymPy custom printing protocol (_latex, _sympystr) for renamed expressions
- Fix duplicate rename() method that was overriding new implementation
- Add _object_viewer() to UWexpression for solver view() integration
- Update solver docstrings to RST format for better rendering
- Add docstring_utils module for consistent docstring rendering
- Update view() methods to work in both Jupyter and terminal environments
- Update tutorials and examples with improved expression display

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- ./uw status: Check for updates on GitHub without pulling
  - Shows commits behind/ahead of remote
  - Displays recent changes available on remote
  - Warns about uncommitted local changes

- ./uw update: Pull latest changes and rebuild
  - Offers to stash uncommitted changes
  - Pulls from current branch
  - Prompts to rebuild underworld3

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Completely rewrote installation.qmd for pixi/./uw approach
  - Removed outdated mamba/conda instructions
  - Added clear environment options table
  - Documented ./uw status and ./uw update commands
  - Simplified HPC section with pixi-first approach

- Updated quickstart.qmd parallel execution section
  - Added ./uw wrapper example for local MPI runs
  - Streamlined text

- Added quick install snippet to index.qmd
  - Shows the 3-line install right on the landing page

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This is a technical design document, not beginner tutorial content.
Moved from docs/beginner/ to docs/developer/design/.

Visualization documentation added to planning system as future work.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- scripts/docstring_sweep.py: Scans Python/Cython files to inventory
  all functions, classes, and methods with their documentation status
- Outputs review_queue.md with prioritized list for interactive enrichment
- Outputs inventory.json for machine processing
- Handles both .py (via AST) and .pyx (via regex) files
- Initial sweep of solvers.py, discretisation/, and ckdtree.pyx:
  - 256 total elements found
  - 131 with no docstring
  - 40 minimal, 73 partial, 12 complete

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert all Markdown math ($...$) to RST format (:math: and .. math::)
- Add module docstrings to 13 files (systems, discretisation, maths, etc.)
- Add/improve class docstrings for core API (Mesh, VarType, SwarmType, etc.)
- Mark internal functions (evaluate_nd, global_evaluate_nd) with See Also refs
- Mark constitutive_models_new.py as deprecated (scheduled for removal)
- Mark units_mixin as deprecated and scheduled for removal
- Remove unused meshing_legacy.py and _utils.py files

Files with new module docstrings:
- __init__.py, _var_types.py, swarm.py, coordinates.py, adaptivity.py
- constitutive_models.py, systems/__init__.py, discretisation/__init__.py
- maths/__init__.py, function/__init__.py, utilities/__init__.py
- cython/__init__.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

2 participants