Published April 22, 2026 | Version v0.9.13
Software Open

bartulem/usv-playpen: usv-playpen v0.9.13

  • 1. Princeton Neuroscience Institute
  • 2. Princeton University

Description

v0.9.13 — Reliability & Hardening Sweep

New Shared Helpers (os_utils.py) wait_for_subprocesses: Replaces 8 copies of while True: poll() (which lacked timeouts and were silent on non-zero exits) across behavioral_experiments, synchronize_files, modify_files, das_inference, and anipose_operations. Each phase now has a sensible hard timeout, terminates still-running children on expiry (SIGTERM + 3s grace + SIGKILL), and logs non-zero return codes.

first_match_or_raise / newest_match_or_raise: Replaces ~20 occurrences of sorted(glob(...))[0], max(glob, key=...), and bare next(rglob(...)). Failures now raise FileNotFoundError naming both the missing pattern and the search root, instead of generic IndexError, ValueError, or StopIteration.

Fixed Avisoft Freeze Detection: New verify_avisoft_is_recording polls the most-recently-created .wav on disk for file-size growth at the start of each recording. This catches frozen-but-running Avisoft states that the old tasklist /STATUS "Not Responding" check silently missed. CoolTerm is now terminated if Avisoft is determined to be dead or frozen.

CUP Mount on User-Switch: Starting a recording with Ethernet left on but the file server unmounted no longer produces "multiple connections by the same user... are not allowed" (Windows System error 1219). All existing connections to \cup are purged at recording start before mounting, across both drive letters and UNC paths.

Subject-ID Field Interference: Widened "remove subject" buttons in Record → Metadata no longer overlap the Next button.

Dialog Return Values: Chemogenetics / Ephys / Lesion / Optogenetics / Edit-intervention dialogs now gate the subject UI refresh on QDialog.Accepted, so pressing Cancel no longer applies partial edits.

SmartDumper: Serializes NumPy scalars (np.float64, np.int32, np.bool_, etc.) by unwrapping them via .item(). Metadata YAMLs no longer fail to dump when they encounter a NumPy value.

SMTP Failures Surfaced: send_email now returns success/failure/no-receivers distinctly and logs the exception type plus SMTP host:port instead of swallowing errors.

Sox Return Code Checked: In load_audio_files, the source .wav is only unlinked after Sox's "correct" pass exits 0 and the corrected file is on disk. Failed conversions no longer silently delete input files.

Empty-slice Crash in A/V Sync: find_audio_sync_trains no longer crashes when an audio IPI event precedes all video frame starts; it now records NaN for that event and continues.

Single-subject Plots: preprocessing_plot pads subject metadata (IDs, genotypes, etc.) to length 2 so sessions with one subject no longer crash on [1] index access.

CLI Config Overrides: set_nested_value_by_path now rejects empty paths and raises KeyError for non-existent components. Typos like video.general.delete-post-copy (hyphen) now fail loudly instead of creating phantom schema keys.

Security Hardening Removed shell=True from Windows CUP mount paths: Mount and delete commands (net use ...) now run as shell=False argv lists. The CUP password is passed as a discrete element rather than interpolated into a string, preventing shell metacharacters in passwords from breaking commands.

Removed shell=True from Raspberry Pi playback scripts: play now runs as an argv list with AUDIODEV passed via env=. playback_5s_USV_train.py now guards against empty directory cases and ensures valid index sampling.

Font Record-metadata and other dialog QLineEdit / QPushButton widgets now render in Helvetica at the intended Y-offset, matching the rest of the GUI.

Files

bartulem/usv-playpen-v0.9.13.zip

Files (57.5 MB)

Name Size Download all
md5:c073ab5387655405b2135c9f461bd60f
57.5 MB Preview Download

Additional details

Related works