Skip to content

Fix PALA convert.py against current pinned zea - #29

Open
RegAItool wants to merge 1 commit into
open-h:mainfrom
RegAItool:fix/pala-zea-compat
Open

Fix PALA convert.py against current pinned zea#29
RegAItool wants to merge 1 commit into
open-h:mainfrom
RegAItool:fix/pala-zea-compat

Conversation

@RegAItool

Copy link
Copy Markdown

Running the PALA example as documented (uv sync, then uv run python examples/pala-ulm-ratbrain/convert.py --download) fails at two points against the zea version pinned in uv.lock:

  1. AttributeError: module 'zea.data.convert' has no attribute 'verasonics' — the verasonics submodule is not imported by the parent package, so the attribute access zea.data.convert.verasonics.bs100bw_to_iq(...) in convert() fails. Fixed by importing the submodule explicitly.

  2. ValueError: In field 'scan': time_to_next_transmit has shape (), expected one of: ('n_frames', 'n_tx'), ('n_timing_intervals',) — the spec no longer accepts a scalar. Fixed by broadcasting the scalar 1/PRF to an (n_frames, n_tx) float32 array.

Verified end-to-end on RF_002.hdf5 (macOS arm64, JAX CPU backend): conversion writes pala_sample.hdf5 (616.5 MB) and reconstruct.py beamforms all 800 frames to the expected rat-brain B-mode.

Unrelated observation while reproducing, in case it's worth a follow-up: single-stream downloads from Zenodo were heavily throttled (~0.2 MB/s) and _download_if_absent treats any existing partial file as complete, so an interrupted download silently produces a corrupt zip on the next run. Happy to file separately.

🤖 Generated with Claude Code

Two runtime failures when running the example as documented:

- zea.data.convert.verasonics is not imported by the parent package, so
  the attribute access in convert() raises AttributeError; import the
  submodule explicitly.
- The zea scan spec now requires time_to_next_transmit with shape
  (n_frames, n_tx) or (n_timing_intervals,); passing a scalar raises
  ValueError in spec validation. Broadcast the scalar 1/PRF instead.

Verified end-to-end on RF_002: convert to zea format (616.5 MB) and
800-frame DAS reconstruction via reconstruct.py both succeed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant