feat(frames): S1 — declared-primitives frame constructors, S>1 capable, pandas-free (#86)#94
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Epic: #85 · S1 (#86) · the keystone, Option D (declare-don't-guess, D-11).
frames.pyis reworked so a forecast can be represented as an(N,S)PredictionFrame— the capability the whole samples epic needs — without any inference:build_prediction_frame/build_target_frameover declared primitives (a 2-D(N,S)array +(time,unit)); a point prediction is declaredS=1.S>1, or a row mismatch — never reshapes/stacks to guess.delivery/.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