Skip to content

No test covers the empty-CAS guard in _predict_admixed #294

Description

@dvitale199

The guard at
genotools/ancestry/model.py:687

if len(cas_train) > 0:

is what stops Birch.fit receiving a (0, 3) array when the reference panel has
no CAS samples. In 1.x that call was unguarded and raised
ValueError: Found array with 0 sample(s) — a real user hit it with an
HGDP + 1KG panel (#202), and it would have hit any panel without CAS.

No test covers it. Nothing under tests/ exercises _predict_admixed with a
panel lacking CAS, so the fix is real but ungated: deleting the if would not
turn the suite red.

Per CLAUDE.md, the test should be revert-checked — break the guard at the
production call site, confirm the new test fails, restore — rather than driving a
helper that happens to sit nearby.

Related: the hardcoded "CAS" label itself is #293.

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

    correctnessWrong or fragile behaviour

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions