Skip to content

feat(frames): S1 — declared-primitives frame constructors, S>1 capable, pandas-free (#86)#94

Merged
Polichinel merged 1 commit into
developmentfrom
feat/s1-frames-declared-primitives
Jun 28, 2026
Merged

feat(frames): S1 — declared-primitives frame constructors, S>1 capable, pandas-free (#86)#94
Polichinel merged 1 commit into
developmentfrom
feat/s1-frames-declared-primitives

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Epic: #85 · S1 (#86) · the keystone, Option D (declare-don't-guess, D-11).

frames.py is reworked so a forecast can be represented as an (N,S) PredictionFrame — the capability the whole samples epic needs — without any inference:

  • exposes build_prediction_frame / build_target_frame over declared primitives (a 2-D (N,S) array + (time,unit)); a point prediction is declared S=1.
  • fails loud (via views-frames' own contract) on a 1-D array, object-dtype sample cells, a target with S>1, or a row mismatch — never reshapes/stacks to guess.
  • drops pandas → representation-free, alongside delivery/.
  • the pandas→primitives unpacking is deferred to the extraction seam (S2 S2 — extraction.py: frame-native sibling readers #87), told the layout when rusty_bucket #143 defines it (no speculative generality).

Tests: conformance suite rewritten to the primitives API — point/sample parity (values carried faithfully, no collapse), assert_frame_contract, and fail-loud cases. No pandas in the test.

CIC: deliberately not added (two thin pure functions; docstring + conformance test are the contract; ADR-006 = non-trivial classes). C-45 updated (S=1/inference/pandas dimensions resolved; unused-on-live-path residual closes at S3 #88).

ruff clean; 129 passed, 43 xfailed.

Closes #86

…e, pandas-free (#86)

Epic #85 / S1, Option D (declare-don't-guess, D-11). frames.py no longer reads pandas
or infers the sample axis: it exposes build_prediction_frame / build_target_frame over
DECLARED primitives — a 2-D (N, S) array + (time, unit) — and fails loud (via views-frames'
own contract) on a 1-D array, object-dtype sample cells, a target with S>1, or a row-count
mismatch. It never reshapes or stacks to guess S.

Consequences:
- S>1 is supported (the (N, 1) point hardcode is gone); a point prediction is declared S=1.
- frames.py drops its pandas import -> representation-free, alongside delivery/.
- The pandas->primitives unpacking is deferred to the extraction seam (S2 #87), told the
  layout when rusty_bucket #143 defines it (no speculative generality here).

Tests: rewrote the conformance suite to the primitives API — point/sample parity (values
carried faithfully, no collapse), assert_frame_contract, and fail-loud cases. No pandas in
the test.

CIC: deliberately not added — two thin pure factory functions are fully specified by the
docstring + the conformance test; ADR-006 governs non-trivial classes, so a formal CIC
would be disproportionate.

Register: C-45 updated — S=1-hardcode / inference / pandas-coupling dimensions resolved;
the unused-on-live-path residual remains until S3 (#88) wires it in.

ruff clean; 129 passed, 43 xfailed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Polichinel Polichinel merged commit 5c38242 into development Jun 28, 2026
4 checks passed
@Polichinel Polichinel deleted the feat/s1-frames-declared-primitives branch June 28, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant