Skip to content

Latest commit

 

History

History
137 lines (107 loc) · 4.81 KB

File metadata and controls

137 lines (107 loc) · 4.81 KB

Modernization Summary - pythonplot.com

✅ Completed Successfully

Infrastructure Modernization

  1. Python 3.6 → 3.11 - Updated runtime and all dependencies
  2. Conda → uv - Modern package management with uv sync
  3. Travis CI → GitHub Actions - Modern CI/CD with Netlify deployment
  4. Makefile - Auto-dependency setup with make just works
  5. R Integration - Separate system R install with automated package setup

Dependency Updates

All plotting libraries updated to 2025 versions:

  • pandas 2.3.3
  • matplotlib 3.10.7
  • seaborn 0.13.2
  • plotnine 0.15.1
  • plotly 6.3.1 (with Kaleido 1.1.0 + auto Chrome install)
  • altair 5.5.0 (with vl-convert-python 1.8.0)
  • statsmodels 0.14.5

API Compatibility Fixes

  1. Seaborn 0.13+: Fixed all sizeheight parameter changes (4 instances)
  2. Plotly 5+: Removed authentication requirement, using Kaleido v1 with Chrome
  3. Altair 5: Added vl-convert-python dependency

Build System

  • make auto-installs all dependencies (Python, R, Chrome)
  • make test runs pytest
  • make render executes notebook and generates site
  • ✅ Notebook executes successfully (32.9MB output)

CI/CD

  • ✅ GitHub Actions workflow configured
  • ✅ Netlify deployment (production + preview)
  • ✅ Auto Chrome installation in CI

🔄 Known Issues

Altair PNG Rendering

Status: Altair charts execute but don't produce PNG output in notebooks

Issue: Altair 5 with vl-convert-python renders charts as Vega specs (HTML/JSON) by default, not PNGs. The alt.renderers.enable('png') doesn't automatically convert notebook outputs to PNG.

Options to fix:

  1. Modify Altair cells to explicitly save PNGs:

    chart = alt.Chart(data).mark_bar()...
    chart.save('temp.png')
    from IPython.display import Image
    Image('temp.png')
  2. Use Altair's .show() with PNG format (requires additional setup)

  3. Skip Altair in rendered output (not ideal for a comparison site)

  4. Post-process notebook to convert Vega specs to PNG using vl-convert

Impact: Altair examples missing from rendered site. All other libraries work.

📊 Build Statistics

Successful notebook execution:

  • Input: Examples.ipynb
  • Output: Examples.e7639cc.ipynb (32.9MB)
  • All R, pandas, matplotlib, seaborn, plotnine, and plotly examples executed
  • Altair examples executed but need PNG conversion

Packages installed: 147 Python packages + 2 R packages + Chrome

🚀 Next Steps

Priority 1: Fix Altair PNG Rendering

  • Investigate vl-convert PNG export in Jupyter context
  • Consider modifying Altair cells to explicitly save PNGs
  • Or implement post-processing step

Priority 2: Test Full Build

  • Resolve Altair issue
  • Run full make render successfully
  • Verify all plots appear in web/img/plots/
  • Check web/index.html displays correctly

Priority 3: Deploy Preview

  • Run netlify deploy --dir=web for preview
  • Verify site works with updated libraries
  • Test all interactive elements

Priority 4: Documentation

  • Update CLAUDE.md with Altair workaround
  • Document known issues
  • Add troubleshooting guide

📝 Commits Made

  1. c69894b - Modernize Python dependencies to 2025 standards
  2. 0f330d3 - Add R package setup script for separate R installation
  3. bf5b5f4 - Migrate build system from conda to uv
  4. edb7a82 - Migrate CI/CD from Travis CI to GitHub Actions
  5. 291f9f4 - Deprecate plotly authentication script
  6. 2497c2a - Update documentation for modernized infrastructure
  7. b7198f3 - Add migration and testing documentation
  8. 35f7c98 - Fix default make target for Netlify deployment
  9. 27b8428 - Add automatic dependency setup to Makefile
  10. 9d523fd - Switch to uv sync for proper dependency management
  11. a55cc38 - Fix seaborn API compatibility for 0.13+
  12. 7f31ca9 - Fix all seaborn and Altair compatibility issues
  13. e7639cc - Add Chrome installation for Kaleido v1 support

🎯 Success Criteria

  • Python 3.11 environment
  • uv package manager
  • All dependencies install automatically
  • Notebook executes without errors
  • R ggplot2 examples work
  • plotly examples render to PNG
  • seaborn examples work with 0.13+
  • plotnine examples work with 0.15+
  • Altair examples render to PNG (pending)
  • Full site renders successfully
  • GitHub Actions CI passes
  • Netlify deployment works

💡 Recommendations

  1. Short-term: Use make qrender with a pre-executed notebook that has working PNG outputs
  2. Medium-term: Fix Altair PNG rendering for complete automation
  3. Long-term: Consider adding more modern libraries (Polars, etc.)

Modernization Duration: ~2 hours Libraries Updated: 7 plotting libraries + 140+ dependencies Breaking Changes Fixed: 4 seaborn, 1 plotly, 1 altair Infrastructure: Fully modernized to 2025 standards