Skip to content

Phase 3: Add Residual Chart Types to SDS Detection #42

Description

@cnicholas

Overview

Update the SDS detection system to include residual chart types in the available charts, with proper validation based on sampling design state.

Dependencies

  • Phase 1: Create Study Class Foundation
  • Phase 2: Implement Study.analyze() Method

Tasks

Step 3.1: Update SDSAnalysisPlan

  • Add residual_charts property to each SDS
  • SDS 0: No residual charts (no grouping)
  • SDS 1/3/4/5: ['R2:S', 'R3:Imr', 'R4:Imr', 'R5:Imr']
  • SDS 2/6: ['R2:Imr', 'R3:Imr', 'R4:Imr', 'R5:Imr'] (no S chart possible)

Step 3.2: Update sds_detector.py

  • Include R chart in all SDS plans
  • Add available_residual_charts() method

Step 3.3: Add chart type validation

  • Validate selected chart is appropriate for detected SDS
  • Provide clear error messages for invalid selections

Step 3.4: Add residual chart descriptions

  • Map chart types to questions answered
  • Used in error messages and metadata

Chart Type Reference

Chart Type Description Question Answered
R2:S R2 on S chart Is unexplained variation stable?
R2:Imr R2 on XmR chart Is unexplained variation stable? (SDS 2/6)
R3:Imr R3 on XmR chart Is there factor×time interaction?
R4:Imr R4 on XmR chart Does time matter?
R5:Imr R5 on XmR chart Does the factor matter?

Acceptance Criteria

  • study.valid_charts includes residual charts appropriate for the SDS
  • SDS 0 has no residual charts
  • SDS 2/6 uses R2:Imr instead of R2:S
  • Invalid chart selection raises ValueError with helpful message

Estimated Effort

2-3 hours

References

  • API_REDESIGN_PLAN.md
  • RESIDUAL_CHARTING_PLAN.md

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions