Skip to content

v0.4.4 - Core Refactoring and Cocycles Fix

Choose a tag to compare

@Routhleck Routhleck released this 04 Sep 02:35
· 36 commits to master since this release

🚀 Major Updates

Core Architecture Refactoring

  • Modular Structure: Split monolithic ripser.rs into organized modules:
    • algorithm.rs - Main Ripser algorithm coordination
    • reduction.rs - Matrix reduction operations
    • assembly.rs - Column assembly logic
  • Improved Code Organization: Enhanced maintainability and readability
  • Better Separation of Concerns: Each module has clear responsibilities

🐛 Cocycles Compatibility Fix

  • Fixed Empty Cocycles Issue: Resolved bug where cocycles were returning empty results
  • Format Compatibility: Cocycles now match original ripser.py format exactly
  • Proper Vertex and Coefficient Handling: Cocycles now correctly include edge vertices and normalized coefficients
  • 2D Array Format: Cocycles are returned as (n_simplices, 3) arrays matching original ripser

🧪 Comprehensive Testing

  • New Test Suite: Added test_cocycles.py with 11 comprehensive test cases
  • Multiple Scenarios: Tests cover single holes, multiple holes, empty cases, sparse matrices
  • Compatibility Verification: Direct comparison with original ripser.py
  • Edge Case Handling: Tests for various coefficient fields and higher dimensions

📊 Test Coverage

✅ test_square_cocycles - Basic cocycle functionality
✅ test_triangle_no_cocycles - No holes case  
✅ test_no_cocycles_flag - Flag disabled case
✅ test_cocycles_compatibility_with_original - Direct ripser.py comparison
✅ test_higher_dimensional_cocycles - H2 and beyond
✅ test_cocycles_with_different_coefficients - Various modulus values
✅ test_multiple_cocycles - Multiple independent holes
✅ test_cocycles_format_consistency - Format validation
✅ test_cocycles_empty_cases - Edge cases
✅ test_cocycles_sparse_matrix - Sparse matrix support
✅ test_cocycles_comprehensive_comparison - Multi-case validation

🔧 Technical Improvements

  • Enhanced Python Interface: Better handling of cocycle format conversion
  • Memory Efficiency: Optimized cocycle storage and processing
  • Error Handling: Improved robustness in edge cases
  • Code Quality: Better documentation and structure

📈 Performance

  • Maintained Speed: Refactoring preserved high-performance characteristics
  • Better Cache Locality: Improved data structure organization
  • Optimized Memory Usage: More efficient cocycle representation

Full Changelog: v0.4.3...v0.4.4