There is a newer version of the record available.

Published November 11, 2025 | Version v0.2.1
Software Open

pollywog

Authors/Creators

Description

Added

  • Decompilation Module (pollywog/decomp.py) - Convert .lfcalc files back to Python code
    • decompile() - Read .lfcalc file and generate Python code
    • decompile_to_string() - Convert CalcSet to Python code string
    • Phase 1: Direct conversion (exact structure recreation)
    • Phase 2: Pattern detection (automatic helper recognition)
  • Pattern Detection (pollywog/patterns.py) - Smart recognition of common calculation patterns
    • WeightedAverage pattern detection
    • Sum pattern detection
    • Product pattern detection
    • Average pattern detection
    • Confidence scoring (>90% threshold)
    • Graceful fallback to direct code
  • Jupyter Magic Command - %pw.load for interactive .lfcalc loading
    • Behaves like built-in %load command
    • First run: decompiles and replaces cell content
    • Second run: executes loaded Python code
    • Integrated with pattern detection
  • Examples and documentation for decompilation workflows
    • examples/decompile_example.py - Comprehensive usage examples
    • examples/pw_load_magic_demo.ipynb - Jupyter magic demonstration

Changed

  • Decompilation now automatically detects and uses helper functions (WeightedAverage, Sum, Product, Average)
  • Generated Python code imports helpers when patterns are detected
  • Enhanced CLAUDE.md with decompilation architecture details

Testing

  • Added 28 new tests (21 pattern detection + 7 integration tests)
  • All 146 tests passing
  • Roundtrip validation: .lfcalc → Python → exec → CalcSet → .lfcalc

Notes

If you use this software, please cite it as below.

Files

endarthur/pollywog-v0.2.1.zip

Files (177.8 kB)

Name Size Download all
md5:218eaf00e6b1663a1c9478b43669cc94
177.8 kB Preview Download

Additional details

Related works