Skip to content

API Reference parrot_pipelines.planogram.comparison.projection

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_pipelines.planogram.comparison.projection

View source

Projection of shelf scores onto the public ComplianceResult vocabulary (FEAT-574).

Alias AssessmentStatus

Re-exported from parrot_pipelines.planogram.contracts.AssessmentStatus.

Alias ComparisonResult

Re-exported from parrot_pipelines.planogram.contracts.ComparisonResult.

Alias CompletenessPolicy

Re-exported from parrot_pipelines.planogram.comparison.definition.CompletenessPolicy.

Alias FacingDefinition

Re-exported from parrot_pipelines.planogram.comparison.definition.FacingDefinition.

Alias FacingStatus

Re-exported from parrot_pipelines.planogram.contracts.FacingStatus.

Alias PositionResult

Re-exported from parrot_pipelines.planogram.contracts.PositionResult.

Alias ReportingPolicy

Re-exported from parrot_pipelines.planogram.comparison.definition.ReportingPolicy.

Alias ShelfScore

Re-exported from parrot_pipelines.planogram.contracts.ShelfScore.

Alias SlotsDefinition

Re-exported from parrot_pipelines.planogram.comparison.definition.SlotsDefinition.

Alias facing_presence

Re-exported from parrot_pipelines.planogram.comparison.presence.facing_presence.

Function finalize_comparison

Attach the projected results and decide overall_compliant.

True only when the assessment is COMPLETE, the list is non-empty and every shelf is COMPLIANT.

finalize_comparison(comparison: ComparisonResult, compliance_results: Sequence[ComplianceResult]) -> ComparisonResult

Parameter Type Default Description
comparison ComparisonResult Output of summarize (with positions / shelf scores attached by the caller).
compliance_results Sequence[ComplianceResult] Output of project_compliance.

Returns: ComparisonResult — A copy with compliance_results and overall_compliant set.

Attribute logger

Function project_compliance

One ComplianceResult per definition shelf, definition order. Sets ComplianceResult.assessment.

Status rules: COMPLIANT iff completely assessed, facing_lenient >= shelf threshold, no mandatory rule failed, no illumination mismatch (zero-facing shelves are checked on lenient_score); MISSING iff completely assessed and every occupied-expected facing is EMPTY; MISPLACED iff completely assessed and every violation is MISPLACED; otherwise NON_COMPLIANT. missing_products lists only occupied-expected facings proven EMPTY (plus illumination pseudo-entries). Expected-empty facings are neither expected nor missing products; UNEXPECTED_OCCUPIED facings are violations listed in unexpected_products.

ShelfScore.rule_results (see score_shelves) holds only status-relevant outcomes: a failed entry blocks COMPLIANT, an unassessed entry makes the shelf incomplete, and a failed entry with a penalty (only illumination rules carry penalties) contributes its detail as an illumination pseudo-entry.

project_compliance(shelf_scores: Sequence[ShelfScore], positions: Sequence[PositionResult], definition: SlotsDefinition, description: PlanogramDescription, *, policy: Optional[ReportingPolicy] = None, completeness: Optional[CompletenessPolicy] = None) -> List[ComplianceResult]

Parameter Type Default Description
shelf_scores Sequence[ShelfScore] Per-shelf scores (definition order).
positions Sequence[PositionResult] Merged positions.
definition SlotsDefinition The slots definition.
description PlanogramDescription The planogram description (per-shelf thresholds).
policy Optional[ReportingPolicy] None Optional reporting policy. The default preserves legacy display labels.
completeness Optional[CompletenessPolicy] None Minimum resolved fraction of a shelf's facings for a complete shelf (default: all).

Returns: List[ComplianceResult] — One result per definition shelf.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally