=PY() + NumPy inside Collabora

Hi Collabora-dev,

I’m excited to say that the MVP is now up on Gerrit:

  1. scaddins: add Calc =PY() Python compute AddIn — Core AddIn, XVolatileResult / #BUSY!, dumb JSON ↔ Any, CppUnit

  2. kit/wsd: broker =PY() to python compute service — kit emitter + coolwsd http::Session POST (same outbound shape as AI chat), feature flag default off, UnitWSD wire test

The Python compute service must be installed separately for now. Those patches are a good start, here’s my high-level take on future work:

Phase Goal
0 — MVP Merge experimental =PY() default-off; publish first compute image
1 — Calc parity Visible short Python errors; auto-spill; plot insert; optional shared kernel (wsd-owned session_id)
2 — Authoring UX Browser Monaco / Run Script / diagnostics (not pywebview in the jail)
3 — Excel files Use LibrePy OOXML rewriter; Online calls convert on open/save (or a thin filter hook)
4 — OCR Expose LibrePy-style local OCR + config settings UI.
5 — Science Helper analysis tools, admin-baked domain stacks in the image

Here’s a list of engine features that unlock Excel parity:

  1. Auto-spill / dynamic arrays for AddIn PY
    Today a single-cell =PY that returns a list/ScMatrix keeps only the top-left value unless entered as a matrix formula. Classic LibrePy fakes spill with UNO write-back + #SPILL!; that is a poor fit for Online. Prefer promoting PY into Calc’s dynamic-array path so that spill ranges are engine-owned and dependents work.

  2. Longer Python in formulas (MAXSTRLEN)
    One formula symbol is still ~1024 chars → Err:513 on real Excel-length scripts inline. We work around with py_code_* sheet banks (>1000 chars). Raising / growing the string-literal limit (toward tens of KB) would retire a lot of that workaround for both Classic and Online.

  3. Plot insert
    Service already returns images[]; Core shows a placeholder. Small kit/LOK insert near the formula cell.

  4. For Excel fidelity beyond round-trip snapshots
    Live Table / structured refs and ANCHORARRAY/spill-parent refs — today we snapshot to A1 on import so files round-trip, but growing tables and live spill parents need real engine support.

Keith