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
k-Wave-python is a Pythoninterface to the k-Wave C++ binaries, which are required to run simulations. The binaries are automatically downloaded when the package runs for the first time.
6
+
k-Wave-python provides both a pure Python/NumPy solver and an interface to pre-compiled C++ binaries. The Python backend works out of the box — no extra dependencies needed.
Uv is "An extremely fast Python package and project manager, written in Rust." We would recommend that you use it. Installation instructions can be found `here <https://docs.astral.sh/uv/getting-started/installation/#installation-methods>`_.
`uv <https://docs.astral.sh/uv/>`_ is used to build and publish to `PyPI <https://pypi.org/>`_.
110
59
111
60
.. note::
112
-
**Alternative to MATLAB:** If you don't have a local MATLAB installation, you can download pre-generated reference artifacts from `GitHub CI <https://nightly.link/waltsims/k-wave-python/workflows/pytest/master/matlab_reference_test_values.zip>`_.
113
-
114
-
115
-
.. _`GitHub CI artifacts link`: https://nightly.link/waltsims/k-wave-python/workflows/pytest/master/matlab_reference_test_values.zip
116
-
117
-
2. Integration Testing
118
-
~~~~~~~~~~~~~~~~~~~~~~
119
-
- Validates ``.h5`` files produced by k-Wave-python against original k-Wave outputs
120
-
- Uses hash values from MATLAB examples stored in JSON files
- These files are committed to the repository and only require updates for new k-Wave releases
123
-
124
-
Generating MATLAB Reference Files
125
-
---------------------------------
126
-
127
-
Process for Creating Reference Files
128
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
129
-
130
-
1. Open target MATLAB example (e.g., ``example_pr_2D_TR_directional_sensors.m`` from the `k-Wave repository <https://github.com/ucl-bug/k-wave/blob/main/k-Wave/examples/example_pr_2D_TR_directional_sensors.m>`_)
4. Run modified example to generate ``.h5`` files in your ``tmp`` folder:
146
-
147
-
- Single function call: creates ``example_input.h5``
148
-
- Multiple calls: creates ``example_input_1.h5``, ``example_input_2.h5``, etc.
149
-
150
-
5. Convert ``.h5`` files to JSON hashes using ``H5Summary``:
151
-
152
-
- Single file: see `lines 92-95 <https://github.com/waltsims/k-wave-python/blob/1f9df5d987d0b3edb1a8a43fad0885d3d6079029/tests/h5_summary.py#L92-L95>`_
153
-
- Multiple files: see `lines 97-106 <https://github.com/waltsims/k-wave-python/blob/1f9df5d987d0b3edb1a8a43fad0885d3d6079029/tests/h5_summary.py#L97-L106>`_
154
-
155
-
Publishing k-wave-python
156
-
-----------------
157
-
158
-
`uv <https://docs.astral.sh/uv/>`_ is used to build and publish k-wave-python to `PyPI <https://pypi.org/>`_.
159
-
160
-
.. note::
161
-
This is only performed by developers with write access to the k-wave-python package on PyPI.
0 commit comments