Skip to content

Commit c5b35b7

Browse files
waltsimsclaude
andcommitted
Add comment clarifying misleading *_source_flag HDF5 field names
These fields carry the source signal length, not a boolean — the naming is inherited from the C++ binary's HDF5 API. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1dfb845 commit c5b35b7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

kwave/solvers/cpp_simulation.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ def _write_hdf5(self, filepath):
195195
"pml_x_size": pml_x_size,
196196
"pml_y_size": pml_y_size,
197197
"pml_z_size": pml_z_size,
198+
# NOTE: Despite the name "*_source_flag", the C++ binary expects
199+
# the number of time points in the source signal (not a boolean).
200+
# 0 = no source, >0 = number of time steps in the source signal.
198201
"p_source_flag": len(source.p[0]) if has_p else 0,
199202
"p0_source_flag": int(has_p0),
200203
"ux_source_flag": len(source.ux[0]) if has_ux else 0,

0 commit comments

Comments
 (0)