Skip to content

Stage 1.12: Polars Phase A — de-index raw/summary/journal in place #457

Description

@jepegit

Part of Stage 1 — behavior-preserving construction (see the Stage-1 tracking issue). Stage 0: #439. Plan documents live in the shared workspace: cellpy-workspace/architecture-plan/ (the architecture-plan repo; formerly architecture-plan/) (alongside the cellpy and cellpy-core repos). Everything in Stage 1 lands on master with the full suite green; nothing flips user-visible behavior.

Goal

Dissolve the three contract-level index conventions while still on pandas
(behavior-preserving — the keys are all also kept as columns today):

  • A1: loaders stop promoting data_point to index; defensive restore/check sites in
    cellreader become asserts, then go.
  • A2: summary no longer indexed by cycle_index (cycle_index_as_index defaults
    off, deprecated via warn_once); consumers read the column.
  • A3: journal pages keyed by a filename/cell-id column; .loc[cell_id, …] →
    mask/join.
  • Seed the Phase-D lint (grep-ban on .index/set_index/iloc outside boundary
    modules) in warn-only mode with the §2.14 allowlist.

Why

Polars has no index; every index-dependent construct must operate on columns before the
Stage-2 flip. Doing it early and separately (report: "the index is redundant state")
keeps the flip PR small and bisectable. Benchmarks (#436) guard against accidental
regressions from the join rewrites.

Links

  • architecture-plan/cellpy2-polars-port-execution-plan.md (Phase A, Phase D)
  • architecture-plan/pandas-to-polars-index-usage-report.md (§1 contract conventions, §2.14 allowlist)
  • Depends on: Stage 0.9: Benchmark harness + v1.x performance baselines #436 baselines committed first; coordinate A1 with Stage 1.3 (same files).

Acceptance

  • Full suite green per sub-step (A1, A2, A3 separate commits/PRs).
  • Benchmarks within band vs baselines.
  • Lint job reports (warn-only) zero new index sites.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cellpy2-stage1cellpy 2 Stage 1: behavior-preserving construction

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions