Skip to content

Add unit tests for SSM helper functions, replacing always-failing stub#333

Merged
alexarje merged 2 commits intomasterfrom
copilot/add-unit-tests-library
Apr 13, 2026
Merged

Add unit tests for SSM helper functions, replacing always-failing stub#333
alexarje merged 2 commits intomasterfrom
copilot/add-unit-tests-library

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

tests/test_ssm.py was a placeholder containing test_always_passes and test_always_fails, breaking the test suite with zero coverage of the SSM module.

Changes

  • tests/test_ssm.py — replaced stub with 19 unit tests covering the two pure-NumPy helpers in musicalgestures/_ssm.py (no FFmpeg or real video required):

TestSmoothDownsampleFeatureSequence

  • Output shape under default params, custom downsampling, and single-feature input
  • Sampling rate reduction (sr / down_sampling)
  • Smoothing correctness: constant signal survives unchanged (interior samples), noisy signal variance is reduced
  • Returned FuncFormatter is callable and produces correct string output
  • All supported window types (boxcar, hann, hamming, blackman) produce valid output
  • Output dtype is always floating-point

TestSlowDot

  • Result matches np.dot for random matrices
  • Identity, shape, single-row, and zero-matrix cases
  • X @ Xᵀ is symmetric
  • Diagonal dominance holds for cosine-similarity SSMs built from normalised rows
# Example: SSM symmetry property now tested
X = rng.random((15, 8))
S = slow_dot(X, X.T, length=15)
np.testing.assert_allclose(S, S.T, atol=1e-12)

Copilot AI linked an issue Apr 13, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add unit tests for package functionality Add unit tests for SSM helper functions, replacing always-failing stub Apr 13, 2026
Copilot AI requested a review from alexarje April 13, 2026 15:45
@alexarje alexarje marked this pull request as ready for review April 13, 2026 16:03
@alexarje alexarje merged commit f5e3d23 into master Apr 13, 2026
2 of 11 checks passed
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.

Make unit tests

2 participants