You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Bump version to 0.6.1, update release plan
v0.6.1 combines: C-order migration, 29 ported examples, 47 parity
tests, 3D PML fix, docs cleanup, infra removal.
Renumber: old v0.6.2 (examples) merged into v0.6.1, old v0.6.3
(features) becomes v0.6.2, old v0.6.4 (axisymmetric) becomes v0.6.3.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Clean up stale Phase 2.x sections in release plan
Remove old Phase 2.1/2.2/2.3 detailed sections (superseded by v0.6.x
summary). Update Testing Strategy and Implementation Order to match
current version numbering.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Walter Simson <waltsims@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
**Goal:** Migrate helper/utility code from Fortran-order to C-order internally, while keeping the legacy API functional. No structural API changes — Future warnings only. Fix hacky shaping/indexing throughout.
**Goal:** Port remaining examples from legacy `kspaceFirstOrder2D/3D` to `kspaceFirstOrder()`, validated against MATLAB reference outputs.
163
-
164
-
### Strategy
165
-
166
-
Port examples one at a time using MATLAB as ground truth — not old Python results. Use the k-wave-cupy interop layer as the bridge between MATLAB and Python.
167
-
168
-
**Per-example workflow:**
169
-
170
-
1.**MATLAB reference** — Run the example in MATLAB k-Wave, save outputs to `.mat`
171
-
2.**k-wave-cupy validation** — Call the Python solver from MATLAB via k-wave-cupy (`simulate_from_dicts`). Compare against MATLAB output. This catches F/C ordering and interop issues at the boundary.
172
-
3.**Standalone Python port** — Port the example to `kspaceFirstOrder()`, compare against the same MATLAB `.mat` reference
173
-
4.**CI fixture** — Add the MATLAB `.mat` as a reference test in `tests/integration/`
174
-
175
-
**Why k-wave-cupy first:** The interop layer handles F→C conversion at the boundary. Validating there first means ordering bugs are caught before they propagate to the standalone Python example. Once the k-wave-cupy version matches MATLAB, the Python port is a straightforward translation.
176
-
177
-
**Order of work:**
178
-
1. Migrate example in k-wave-cupy repo (MATLAB calls Python solver)
179
-
2. Validate against MATLAB reference output
180
-
3. Port the standalone Python example in k-wave-python
181
-
4. Add integration test with `.mat` fixture
182
-
183
-
### Examples to port
184
-
185
-
| Example | Blocker | Resolution |
186
-
|---------|---------|------------|
187
-
|`pr_2D_TR_line_sensor`, `pr_3D_TR_planar_sensor`|`TimeReversal` class uses legacy API internally | Refactor `TimeReversal` to call `kspaceFirstOrder()`|
188
-
|`us_defining_transducer`, `us_beam_patterns`, `us_bmode_linear_transducer`, `us_bmode_phased_array`|`NotATransducer`-as-source pipeline untested with new API | Validate transducer pipeline end-to-end via k-wave-cupy first |
189
-
|`checkpointing/checkpoint.py`|`checkpoint_file`/`checkpoint_timesteps` not exposed in new API | Add checkpoint kwargs to `kspaceFirstOrder()`|
190
-
191
-
---
192
-
193
-
## Phase 2.3: v0.6.3 - Axisymmetric Support
194
-
195
-
**Goal:** Add axisymmetric simulation to `kspaceFirstOrder()` and port AS examples.
196
-
197
-
**What axisymmetric means:** Dimensionality reduction for problems with cylindrical symmetry. A 3D symmetric problem is simulated on a 2D (r, z) half-domain; a 2D symmetric problem on a 1D half-domain. Results are mirrored around the symmetry axis to reconstruct the full field.
198
-
199
-
**Current state:**`kspaceFirstOrderAS.py` / `kspaceFirstOrderASC.py` are standalone entry points using the legacy `kWaveSimulation` pipeline. The new API hardcodes `axisymmetric_flag=0`.
200
-
201
-
**Design:** Not a separate solver — a wrapper around `kspaceFirstOrder()` that:
202
-
1. Takes `axisymmetric=True` kwarg
203
-
2. Reduces the grid to a half-domain (y ≥ 0 = radial direction)
204
-
3. Adds radial symmetry terms: special PML at axis (no absorption at y=0), expanded grid for FFT symmetries (WSWA: 4× radial, WSWS: 2×-2), radial coordinate vectors for geometric source terms
205
-
4. Runs the lower-dimensional simulation via `Simulation`
**Status: implemented on `c-order-migration` branch**
227
-
228
-
Atomic migration of all solver internals from Fortran-order to C-order. The `kspaceFirstOrder()` API is experimental pre-1.0, so output shape changes are acceptable without a deprecation cycle.
229
-
230
-
**Changes:**
231
-
-`kspace_solver.py`: all `flatten(order="F")`/`reshape(..., order="F")` → `ravel()`/`reshape()`. C-order strides for bilinear interpolation.
232
-
-`cpp_simulation.py`: `_fix_output_order()` transposes full-grid fields and permutes sensor time-series rows from F-indexed to C-indexed.
- Separate `p_thresh` / `p_final_thresh` per example (machine precision for time-series)
250
-
-`jupytext.toml` + `generate-notebooks.yml` — auto-generates `.ipynb` on merge to master
142
+
- Old subdirectory examples in `examples/legacy/`
251
143
-`run-examples.yml` triggers on PRs touching `examples/`, excludes `legacy/`
252
-
- Deleted dead `test_example.yml`
253
144
254
-
**Remaining for v0.6.2:**
255
-
1.**Docs example gallery** — Add nbsphinx or sphinx-gallery to docs build; render generated notebooks as HTML pages with "Open in Colab" badges. Wire into `test_pages.yml`.
-**Tier 3 (weekly + PR):**`run-examples.yml` — runs all examples end-to-end
265
-
-**`matlab_parity` marker** registered in `pytest.ini` for selective runs
150
+
**Docs & infra cleanup:**
151
+
-README: Python-first framing, both backends described
152
+
-Dev docs: simplified setup with `uv sync`, removed outdated sections
153
+
-macOS C++ hint in executor.py (scoped to linker errors)
154
+
-Deleted: Makefile, Dockerfile, run_examples.py, notebook pipeline, dead CI workflows
266
155
267
-
### v0.6.3 — New Features + Updated Examples
156
+
### v0.6.2 — Tier 2 Features + Examples
268
157
269
-
**Goal:** Add solver features needed by Tier 2 examples, port those examples, update docs gallery.
158
+
**Goal:** Add solver features needed by Tier 2 examples, port those examples.
270
159
271
160
**Features to add:**
272
-
-**Time-reversal reconstruction** — needed by 9 PR examples (`pr_2D_TR_*`, `pr_3D_TR_*`)
161
+
-**Time-reversal reconstruction** — needed by PR examples (`pr_2D_TR_*`, `pr_3D_TR_*`)
273
162
-**Rectangular/corner sensor masks** — needed by 5 examples
274
163
-**`sound_speed_ref`** — needed by `tvsp_slit_diffraction`
275
164
-**Frequency-response sensor** — needed by `ivp_sensor_frequency_response`
276
165
-**Directional sensor** — needed by `sd_sensor_directivity_2D`
277
166
278
-
**Per-feature workflow:**
279
-
1. Implement feature in solver (`kspace_solver.py`)
280
-
2. Port the MATLAB examples that need it
281
-
3. Generate MATLAB references, add parity tests
282
-
4. Update docs gallery with new examples
167
+
**Also:**
168
+
- CuPy GPU validation on DigitalOcean (29 examples ready)
169
+
- Real-world validation (published paper simulations)
170
+
- Consolidate test infrastructure (`tests/integration/` + `test_example_parity.py`)
283
171
284
172
**Simplification targets:**
285
173
- Delete `examples/legacy/` once all examples are ported or confirmed obsolete
286
-
- Consolidate `tests/integration/` and `tests/test_example_parity.py` test infrastructure
287
174
- Remove unused MATLAB collector infrastructure if parity tests replace it
288
175
- Audit `kWaveSimulation_helper/` — delete helpers superseded by `kspaceFirstOrder()`
289
176
290
-
### v0.6.4 — Axisymmetric Support
177
+
### v0.6.3 — Axisymmetric Support
291
178
292
179
Axisymmetric = dimensionality reduction (3D→2D or 2D→1D). Not a separate solver — wrapper around `kspaceFirstOrder()` with radial symmetry terms added to the wave equation.
293
180
@@ -389,96 +276,30 @@ result = kspaceFirstOrder(kgrid, medium, source, sensor,
389
276
390
277
## Testing Strategy
391
278
392
-
**Existing (keep):**
393
-
- MATLAB reference tests via CI (66 MATLAB collectors → `.mat` fixtures, `scipy.io.loadmat`)
0 commit comments