Skip to content

CM/PGM → PredictionFrame adapters #33

Closed

Description

@Polichinel

Epic: #31 · Depends on: #32

Background

Phase 1 added to_prediction_frame() for pgm data (views_postprocessing/unfao/frames.py, SpatialLevel.PGM, unit = priogrid_gid). Reconciliation also needs the cm side (SpatialLevel.CM, unit = country_id) and must return a reconciled pgm frame without mutating its input (de-mutation; views-reporting register C-184).

Work

  • Extend the frame adapters so cm prediction data → PredictionFrame at SpatialLevel.CM (unit = country_id), reusing the existing pgm path.
  • Keep the boundary thin (pandas→numpy only where the input is still a DataFrame); one concept per file.

Acceptance criteria

  • cm and pgm PredictionFrames build from the S0 fixture's inputs.
  • views_frames.conformance.assert_frame_contract passes for both.
  • Identifiers round-trip to (month_id, country_id) and (month_id, priogrid_gid).
  • Inputs are not mutated.

Validation

  • Unit tests alongside tests/test_views_frames_conformance.py.

Notes

  • Reuse views_postprocessing/unfao/frames.py:to_prediction_frame; the cm variant differs only in level/unit.

Activity

  1. added
    story
    implementation
    reconciliation
    on Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    implementationreconciliationstory

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions