Skip to content

Project hardening: tests, bug fixes, versioning, CI, and docs - #9

Merged
joeljose merged 6 commits into
mainfrom
feature/project-hardening
Mar 20, 2026
Merged

Project hardening: tests, bug fixes, versioning, CI, and docs#9
joeljose merged 6 commits into
mainfrom
feature/project-hardening

Conversation

@joeljose

Copy link
Copy Markdown
Owner

Summary

  • Add 22 unit tests (pytest) covering all core functions with tiered tolerances
  • Fix bugs: fps truncation, load_video buffer overflow, flattop window size guard
  • Remove dead np.int monkey-patch (dtcwt 0.14.0 doesn't need it)
  • Add VERSION file, Docker image version labels and tags
  • Modernize CI: Docker-based with ruff linting, actions/checkout v6
  • Add test.sh for local dev testing inside Docker
  • Add CHANGELOG.md, design doc, requirements-dev.txt
  • Pin dtcwt upper bound (<1)
  • Update README with Development section and CONTRIBUTING with test.sh

Fixes #1, fixes #2, fixes #3, fixes #4, fixes #5, fixes #6, fixes #7, fixes #8

Test plan

  • All 22 tests pass inside Docker via ./test.sh
  • Ruff lint passes
  • Full pipeline smoke test passes (face.mp4, k=3, w=80, nlevels=4)
  • np.int patch removal verified: dtcwt 0.14.0 works without it
  • fps fix verified: cv2.VideoWriter accepts float fps

Remove np.int monkey-patch — dtcwt 0.14.0 doesn't need it.
Keep fps as float instead of truncating with int() (3.2% error on 29.97fps).
Add frame_count guard in load_video to prevent buffer overflow.
Guard flattop_filter_1d against zero window size.

Fixes #2
Single source of truth for version in VERSION file. Build script
reads from it, tags image, and passes version as Docker build arg.

Fixes #3
Add requirements-dev.txt (pytest, ruff), tests directory with initial
format_duration tests. Dockerfile installs dev deps and copies tests.
test.sh builds image if needed, runs lint + tests inside Docker.
Fix ruff F541 lint error.

Fixes #4
Tier 1: normalize_phase (unit magnitude, zero safety, phase preservation).
Tier 2: flattop_filter (DC passthrough, smoothing, small width guard),
extract_temporal_phases (constant phase, output shape).
Tier 3: magnify_motions smoke tests (shape, dtype, finite values).
Buffer guard test with mocked VideoCapture.
Input validation: all CLI error paths.

Fixes #5, fixes #6
Run all CI steps inside Docker matching dev workflow. Add ruff lint
step. Update actions/checkout to v6. Remove actions/setup-python
(not needed with Docker).

Fixes #7
Create CHANGELOG.md (Keep a Changelog, starting fresh).
Commit design doc covering architecture decisions and hardening plan.
Pin dtcwt upper bound to <1. Add Development section to README
(testing, versioning, project structure). Update CONTRIBUTING.md
with test.sh instructions.

Fixes #8
@joeljose
joeljose merged commit 69f541b into main Mar 20, 2026
1 check passed
@joeljose
joeljose deleted the feature/project-hardening branch March 20, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant