endolith / endolith/waveform-analysis
De-duplicate test WAVs against scipy's bundled test data
- Dominant language
- Python
- Stars
- 287
- Forks
- 83
- Avg merge
- 16m
- Merged PRs (30d)
- 2
Description
19 of the 24 WAV files in tests/test_files/ are byte-identical duplicates of scipy's bundled test fixtures at scipy/io/tests/data/ (verified byte-for-byte). scipy is a hard dependency (requirements.txt), installed in every CI job, so these could be referenced directly instead of duplicated.
Affected files (present in both locations): all of the test-44/48/8k*.wav files; the unique repo-only files are the two Ocenaudio files, short_sine.flac/mp3, and test-1234Hz-le-1ch-10S-20bit-extra.wav.
Proposal:
1. Add a helper (e.g. tests/subprocess_helpers.py) that resolves a test WAV to scipy/io/tests/data/ when present, else tests/test_files/.
2. Route test_files_dir references in the 6 test files through it.
3. Delete the duplicated files, keep the 5 unique ones.
Caveats:
- scipy/io/tests/data/ is a private path, not a stable public API.
- Files are used as property references (1 kHz, -3.01 dBFS, channel counts), so fixture content must stay stable.
- The 2 on-the-fly generated tests (int32 scaling in test_common.py, subsecond in test_scripts_invoked.py) need known signal content; verify before switching.
Cleanup only; no behavior change.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the test_files_dir references in the six test files and the proposed tests/subprocess_helpers.py, then compare scipy/io/tests/data/ with tests/test_files/. Verify the int32 scaling and subsecond generated tests in test_common.py and test_scripts_invoked.py before changing their fixtures. Done means tests pass, 19 duplicate WAVs are removed, and the five unique files remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100