Skip to content

Complete or document Sampling Design State detection (only handles SDS 1-2) #18

Description

@cnicholas

The docstring for __calculate_sampling_design_state() (lines 1385-1399) describes 6 sampling design states but the implementation only handles SDS 1 and 2.

From docstring

- SDS1: every (k,t) cell has n>=2
- SDS2: every (k,t) cell has n==1
- SDS3: mixture of replication (some n==1 and some n>=2) and/or missing (k,t) cells
- SDS4: single design condition over time (K==1 with time present)
- SDS5: nested design (>=2 design vars) with asynchronous time coverage
- SDS6: unstructured fallback (no time OR cannot form (k,t) cells)

Actual implementation

if all(group_sizes>=2): out = 1
if all(group_sizes==1): out = 2
# Everything else returns 0

Impact

  • Misleading documentation
  • Silent failures for SDS 3-6 cases
  • Incomplete feature

Fix Options

Option 1: Implement SDS 3-6 detection
Option 2: Update docs to state only SDS 1-2 supported and raise error for other cases

Files

  • analysis_dataset.py

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

    bugSomething isn't workingdocumentationImprovements or additions to documentationpriority-mediumMedium priority

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions