Fix Issue #38: Resolve cycle boundary failures in get_musical_time()#39
Fix Issue #38: Resolve cycle boundary failures in get_musical_time()#39
Conversation
) - Change boundary condition from >= to > to allow exact end time - Add comprehensive test for cycle boundary scenarios - Update existing boundary test to reflect correct behavior - Resolves trajectory visualization issues at cycle boundaries Fixes issue where get_musical_time() returned False for timestamps at exact cycle boundaries, causing missing trajectory curves in meter-time visualizations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed _pulse_index_to_hierarchical_position method to prevent negative positions when correcting pulse indices across cycle boundaries. The method now uses modulo arithmetic to correctly determine within-cycle positions, resolving "All hierarchical positions must be non-negative" errors that occurred with offset pulses from real transcription data. This completes the comprehensive fix for Issue #38, ensuring get_musical_time() works correctly with both theoretical and actual pulse timing variations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
📦 Test Package Built Successfully! This PR has been automatically built and uploaded to TestPyPI for testing. 🔗 TestPyPI Link: https://test.pypi.org/project/idtap/ To test this version: pip install --index-url https://test.pypi.org/simple/ idtap✅ All tests passed and package builds successfully. |
|
@claude review |
|
Claude finished @jon-myers's task —— View job Code Review ProgressReviewing PR #39: Fix Issue #38 - Resolve cycle boundary failures in get_musical_time() Todo List:
Code Review SummaryThis PR successfully addresses Issue #38 by implementing comprehensive pulse-based boundary calculation in ✅ StrengthsComprehensive Boundary Logic (
|
Summary
get_musical_time()failures at cycle boundaries in multi-repetition meters_pulse_index_to_hierarchical_position()method to use proper modulo arithmeticChanges Made
get_musical_time()to use actual next cycle pulse timing for intermediate cycles instead of theoretical end times_pulse_index_to_hierarchical_position()to prevent negative positions using modulo arithmeticIssues Resolved
get_musical_time()returningFalsefor valid times at cycle boundariesTest Results
Backwards Compatibility
Fully backwards compatible - no breaking changes to existing API or behavior for correctly timed data.
🤖 Generated with Claude Code