Skip to content

Commit 1fbc8d4

Browse files
authored
Merge pull request #32 from underworldcode/uw3-release-candidate
UW3 release candidate
2 parents a72ebde + 6785bb9 commit 1fbc8d4

File tree

706 files changed

+251673
-16391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

706 files changed

+251673
-16391
lines changed

.claude/commands/check-patterns.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
description: Find deprecated access patterns in code and documentation
3+
---
4+
5+
## Reference Document
6+
7+
**Read the authoritative patterns guide first:**
8+
`docs/developer/UW3_Style_and_Patterns_Guide.qmd`
9+
10+
Key sections:
11+
- Section 4 "Array and Data Management" - array indexing patterns
12+
- Section 5 "Context Managers" - deprecated vs current access patterns
13+
- Section 6 "MPI and Parallel Patterns" - parallel safety
14+
15+
---
16+
17+
## Search for Legacy Patterns
18+
19+
### Source Code
20+
```bash
21+
grep -r "with.*\.access(" src/underworld3/ --include="*.py"
22+
```
23+
24+
### Examples
25+
```bash
26+
grep -r "with.*\.access(" docs/examples/ --include="*.py"
27+
grep -r "mesh\.data\[" docs/examples/ --include="*.py"
28+
```
29+
30+
### Documentation (markdown, quarto)
31+
```bash
32+
grep -r "with.*\.access(" docs/ --include="*.md" --include="*.qmd"
33+
grep -r "mesh\.data\[" docs/ --include="*.md" --include="*.qmd"
34+
```
35+
36+
### Notebooks
37+
```bash
38+
find docs -name "*.ipynb" -exec grep -l "\.access(" {} \;
39+
find docs -name "*.ipynb" -exec grep -l "mesh\.data" {} \;
40+
```
41+
42+
### Tests (IMPORTANT: Tests are a source of truth for AI tools)
43+
```bash
44+
grep -r "with.*\.access(" tests/ --include="*.py"
45+
grep -r "mesh\.data\[" tests/ --include="*.py"
46+
```
47+
48+
---
49+
50+
## Pattern Classification
51+
52+
| Pattern | Status | Replacement |
53+
|---------|--------|-------------|
54+
| `with mesh.access(var):` | **Deprecated** | Direct: `var.data[...]` |
55+
| `with swarm.access(var):` | **Deprecated** | Direct: `var.data[...]` |
56+
| `mesh.data` (coordinates) | **Deprecated** | `mesh.X.coords` |
57+
| `var.array[:, 0, 0]` | Current | Scalar indexing |
58+
| `var.array[:, 0, :]` | Current | Vector indexing |
59+
| `uw.synchronised_array_update()` | Current | Multi-variable batch |
60+
61+
---
62+
63+
## Analysis Required
64+
65+
For each occurrence found, classify as:
66+
- **Safe to remove**: Simple data access, visualization, I/O
67+
- **Preserve for now**: Solver-critical operations needing further analysis
68+
- **Already correct**: Part of the access context implementation itself
69+
70+
## Output Format
71+
72+
- Total occurrences by location (src, examples, docs, notebooks, **tests**)
73+
- Files needing updates grouped by type
74+
- Priority order:
75+
1. User-facing examples (docs/examples)
76+
2. **Tests** (source of truth for AI tools writing notebooks)
77+
3. Documentation (notebooks, markdown)
78+
4. Source code
79+
- Recommended fixes
80+
81+
---
82+
83+
## Docstring Health Checks
84+
85+
### Regenerate Inventory
86+
```bash
87+
pixi run -e default python scripts/docstring_sweep.py
88+
```
89+
90+
### Quick Statistics
91+
```bash
92+
# Count items by status in review queue
93+
grep -c "none" docs/docstrings/review_queue.md || echo "0"
94+
grep -c "minimal" docs/docstrings/review_queue.md || echo "0"
95+
grep -c "partial" docs/docstrings/review_queue.md || echo "0"
96+
grep -c "complete" docs/docstrings/review_queue.md || echo "0"
97+
```
98+
99+
### Format Inconsistencies
100+
```bash
101+
# Find Markdown math in source (should be RST :math: format)
102+
grep -rn '\$[^$]*\$' src/underworld3/ --include="*.py" | grep -v "test_" | head -20
103+
```
104+
105+
### Reference
106+
- Full inventory: `docs/docstrings/review_queue.md` (with NEEDS_* flags)
107+
- Conversion plan: `docs/plans/docstring-conversion-plan.md`
108+
- Target format: NumPy/Sphinx with RST math (`:math:`, `.. math::`)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
description: Check regression test suite status
3+
---
4+
5+
Run the regression test suite and report on any failures:
6+
7+
```bash
8+
pixi run -e default pytest tests/test_06*_regression.py -v --tb=short
9+
```
10+
11+
## Analysis Required
12+
13+
- Count total tests and number passing/failing
14+
- For each failure, identify:
15+
- Test name and location
16+
- Error type (AttributeError, AssertionError, etc.)
17+
- Root cause category (API assumption issue, actual bug, naming convention)
18+
- Provide summary with recommended next actions
19+
20+
## Output Format
21+
22+
- Summary: X/Y tests passing
23+
- Failures grouped by category
24+
- Recommended fixes for each failure type

.claude/commands/test-solvers.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
description: Validate complex solver tests
3+
---
4+
5+
Run the complex solver test suite to validate core physics functionality:
6+
7+
```bash
8+
# Test Stokes solvers
9+
pixi run -e default pytest tests/test_101*_Stokes*.py -v --tb=short
10+
11+
# Test advection-diffusion solvers
12+
pixi run -e default pytest tests/test_110*_AdvDiff*.py -v --tb=short
13+
14+
# Test other complex systems
15+
pixi run -e default pytest tests/test_11*_*.py -v --tb=short
16+
```
17+
18+
## Analysis Required
19+
20+
- Report pass/fail counts for each category (Stokes, AdvDiff, Other)
21+
- For failures, categorize by:
22+
- Solver type
23+
- Error pattern (convergence, numerical accuracy, API usage)
24+
- Identify if failures are related to recent changes
25+
26+
## Critical Note
27+
28+
These tests validate core physics. Any failures are **high priority**.
29+
30+
## Output Format
31+
32+
| Test Category | Total | Passed | Failed |
33+
|---------------|-------|--------|--------|
34+
| Stokes | | | |
35+
| AdvDiff | | | |
36+
| Other | | | |
37+
38+
- Detailed failure analysis grouped by solver type
39+
- Assessment: Are failures new regressions or pre-existing?

.claude/commands/test-tier-a.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
description: Run only Tier A (production-ready) tests - trusted for TDD and CI
3+
---
4+
5+
Run only the most reliable, production-ready tests:
6+
7+
```bash
8+
pixi run -e default pytest -m "tier_a" -v --tb=short
9+
```
10+
11+
## What This Tests
12+
13+
**Tier A tests are:**
14+
- Long-lived tests with proven track record (>3 months)
15+
- Consistently passing across multiple environments
16+
- Testing stable, well-understood functionality
17+
- Failure indicates **DEFINITE regression** in production code
18+
19+
## When to Use
20+
21+
- Test-Driven Development (TDD) sprints
22+
- Continuous Integration (CI) pipelines
23+
- Release validation
24+
- Bisecting regressions (these tests can be trusted)
25+
26+
## If a Tier A Test Fails
27+
28+
**HIGH PRIORITY** - This indicates a real regression:
29+
1. Investigate immediately
30+
2. Bisect to find breaking commit
31+
3. Fix production code (or demote test if incorrectly promoted)
32+
33+
## Reference
34+
35+
See `docs/developer/TESTING-RELIABILITY-SYSTEM.md` for tier definitions.

.claude/commands/test-tier-ab.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
description: Run Tier A+B tests - full validation suite
3+
---
4+
5+
Run production-ready and validated tests (excludes experimental):
6+
7+
```bash
8+
pixi run -e default pytest -m "tier_a or tier_b" -v --tb=short
9+
```
10+
11+
## What This Tests
12+
13+
**Tier A:** Production-ready (failures = definite regression)
14+
**Tier B:** Validated but newer (failures need investigation)
15+
16+
## When to Use
17+
18+
- Full validation before merging
19+
- Feature completion verification
20+
- Manual review of new functionality
21+
22+
## Interpreting Results
23+
24+
| Tier | If Fails | Action |
25+
|------|----------|--------|
26+
| A | HIGH priority | Investigate immediately - real regression |
27+
| B | MEDIUM priority | Could be test OR code issue - investigate |
28+
29+
## Reference
30+
31+
See `docs/developer/TESTING-RELIABILITY-SYSTEM.md` for tier definitions.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
description: Analyze units test failures and classify for reliability tiers
3+
---
4+
5+
Run units tests and classify any failures by reliability tier:
6+
7+
```bash
8+
pixi run -e default pytest tests/test_07*_units*.py tests/test_08*_*.py -v --tb=short 2>&1 | head -200
9+
```
10+
11+
## Classification Criteria
12+
13+
### Tier A Candidates (Production-Ready)
14+
- [ ] Test has existed for >3 months
15+
- [ ] Test passes consistently
16+
- [ ] Functionality is stable and production-used
17+
- [ ] Failure would indicate definite bug
18+
19+
### Tier B Candidates (Validated)
20+
- [ ] Test passes at least once
21+
- [ ] Functionality appears correct
22+
- [ ] Needs more production validation
23+
- [ ] Test is new (<3 months)
24+
25+
### Tier C Candidates (Experimental)
26+
- [ ] Feature is not fully implemented
27+
- [ ] Test documents expected future behavior
28+
- [ ] Known issues exist
29+
30+
## Analysis Required
31+
32+
For each failing test:
33+
1. Identify root cause (test issue vs code issue)
34+
2. Classify into appropriate tier
35+
3. Recommend: fix, mark xfail, or remove
36+
37+
## Output Format
38+
39+
| Test File | Status | Tier | Recommendation |
40+
|-----------|--------|------|----------------|
41+
| test_0700_* | Pass/Fail | A/B/C | Action needed |
42+
43+
## Reference
44+
45+
See `docs/developer/TEST-CLASSIFICATION-2025-11-15.md` for current status.

.claude/commands/test-units.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
description: Quick validation of units system
3+
---
4+
5+
Run the complete units test suite to ensure dimensional analysis is working:
6+
7+
```bash
8+
pixi run -e default pytest tests/test_07*_units*.py tests/test_08*_*.py -v --tb=short
9+
```
10+
11+
## Expected Results
12+
13+
Most tests should pass. Check `docs/developer/TEST-CLASSIFICATION-2025-11-15.md` for current baseline.
14+
15+
## Analysis Required
16+
17+
If failures occur, identify which subsystem:
18+
- **Core units** (test_0700): Fundamental units system
19+
- **Unit conversion** (test_0801): Utility functions
20+
- **Workflow integration** (test_0803): End-to-end workflows
21+
- **Stokes ND** (test_0818): Non-dimensional solver integration
22+
- **Coordinate units**: Dimensional analysis of mesh coordinates
23+
24+
## Output Format
25+
26+
- Quick status: X/Y tests passing
27+
- If failures: detailed breakdown by subsystem
28+
- Assessment: regression vs known issue
29+
- Recommended fixes if needed

0 commit comments

Comments
 (0)