k-wave-python icon indicating copy to clipboard operation
k-wave-python copied to clipboard

Consolidate cartesian interp option and introduce structured SimulationResult return

Open faridyagubbayli opened this issue 2 months ago • 3 comments

I removed the duplicate cart_interp option and kept cartesian_interp to make the API clear and consistent, then switched the executor return from a loose dotdict to a typed SimulationResult. This cuts confusion around options, improves IDE help and readability, and makes it safer and simpler to work with outputs from the k‑Wave binaries.

Changes

  • kwave/options/simulation_options.py: removed cart_interp, kept cartesian_interp, cleaned docs/validation.
  • tests/test_tvsp_3D_simulation.py, tests/test_ivp_3D_simulation.py: switched to cartesian_interp.
  • kwave/data.py: added SimulationResult dataclass (+ from_dotdict).
  • kwave/executor.py: return SimulationResult from run_simulation.
  • kwave/kspaceFirstOrder2D.py, kwave/kspaceFirstOrder3D.py, kwave/kspaceFirstOrderAS.py: updated return annotations/imports.
  • tests/test_executor.py: assertions now expect SimulationResult.

Compatibility

  • Non-breaking at call sites; return type is now structured. Consumers relying on dict-like access should migrate to attributes.

Tests

  • Updated unit tests pass locally; basic import/creation of SimulationResult verified.

Summary by CodeRabbit

  • Breaking Changes

    • SimulationOptions parameter renamed from cart_interp to cartesian_interp (update call sites).
  • New Features

    • Simulation solvers now return a structured SimulationResult object consolidating grid info and arrays for pressure, velocity, and intensity.
  • Tests

    • Tests updated to expect and validate the new structured SimulationResult outputs.

faridyagubbayli avatar Oct 30 '25 14:10 faridyagubbayli