Skip to content

Clean up internals, fix bugs, add tests + CI#15

Merged
bleugreen merged 8 commits intomainfrom
agent/DPRT-4-builder-1
Feb 22, 2026
Merged

Clean up internals, fix bugs, add tests + CI#15
bleugreen merged 8 commits intomainfrom
agent/DPRT-4-builder-1

Conversation

@bleugreen
Copy link
Owner

Summary

Remove internal/unused code, fix several bugs, deduplicate utils, and add a basic test suite with CI.

Changes

Removed unused code

  • Deleted model/train.py, dataset/, bench/, requirements.txt
  • Deleted model/infer.py after extracting load_cnn_model() into predictor.py

Bug fixes

  • hcqm.py: Changed device='cuda' default to device=None, resolved with get_device() — no longer crashes on CPU-only machines
  • load_cnn_model(): Added weights_only=True to torch.load()
  • batch_infer.py: Guarded torch.cuda.empty_cache() with is_available() check
  • batch_infer.py: Fixed indentation, removed stray pass

Code deduplication (utils.py)

  • split_audio() is now the core implementation
  • load_and_split_audio() is a thin wrapper that loads then delegates
  • split_audio raises ValueError on too-short audio instead of silently returning None
  • load_and_split_audio catches exceptions with a clear error message

Package structure

  • Added __init__.py to model/ and audio_proc/
  • Fixed circular import between predictor.py and batch_infer.py
  • Organized imports across touched files

Packaging (pyproject.toml)

  • Added missing requests runtime dependency
  • Added optional dev dependencies (pytest, ruff)
  • Added ruff + pytest config

Tests + CI

  • 7 tests covering BPM conversion, audio splitting, predictor instantiation, and end-to-end prediction
  • GitHub Actions workflow: lint with ruff, run pytest on PRs and pushes to main

Verification

  • pip install -e ".[dev]" — installs cleanly
  • ruff check src/ — all checks passed
  • pytest — 7/7 pass
  • python -m deeprhythm.infer --help — CLI works

@bleugreen bleugreen force-pushed the agent/DPRT-4-builder-1 branch from 1635962 to 6ac0187 Compare February 22, 2026 03:50
@bleugreen bleugreen force-pushed the agent/DPRT-4-builder-1 branch 2 times, most recently from cb20dfb to d8134cb Compare February 22, 2026 03:52
@bleugreen bleugreen force-pushed the agent/DPRT-4-builder-1 branch from d8134cb to acb873c Compare February 22, 2026 03:52
@bleugreen bleugreen force-pushed the agent/DPRT-4-builder-1 branch from ae8a2a3 to b7bda6c Compare February 22, 2026 03:53
@bleugreen bleugreen force-pushed the agent/DPRT-4-builder-1 branch from b7bda6c to 1e98553 Compare February 22, 2026 03:53
@bleugreen bleugreen merged commit 717c517 into main Feb 22, 2026
1 check 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.

1 participant