Skip to content

Add predict_pairs(skip_unsupported=True) (#263) - #264

Merged
iskandr merged 1 commit into
masterfrom
skip-unsupported-pairs
Jul 11, 2026
Merged

Add predict_pairs(skip_unsupported=True) (#263)#264
iskandr merged 1 commit into
masterfrom
skip-unsupported-pairs

Conversation

@iskandr

@iskandr iskandr commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Closes #263.

predict_pairs / predict_pairs_dataframe raise UnsupportedAllele on the first allele the predictor cannot score, which fails the whole batch. A caller scoring a mixed set of alleles — some outside an older tool's supported list — had to pre-filter the alleles itself or drop to a per-allele loop.

Change

Add skip_unsupported=False. When True, score the supported pairs and skip the rest:

  • predict_pairs leaves an unsupported pair as None; the list length and order are preserved, so results still align 1:1 with the input.
  • predict_pairs_dataframe omits the unsupported rows (the frame can be shorter than the input).
  • The skipped alleles are logged once at WARNING.

Default behavior is unchanged: with skip_unsupported=False an unsupported allele still raises UnsupportedAllele before any command runs.

Internally, _resolve_supported_allele_cli_names is split into a non-raising _partition_supported_allele_cli_names (returns (cli_names, unsupported)) plus the existing raising wrapper.

Tests

Five new cases in tests/test_commandline_predict_pairs.py (stub predictor, no binary): supported/unsupported mix returns None in place and never runs the unsupported allele; the WARNING names the skipped allele; an all-unsupported batch returns all-None / empty frame; the dataframe omits skipped rows. Existing raise-by-default test unchanged. 12 passed.

https://claude.ai/code/session_01SZZUQruWNznzAJSN4FpDGs

predict_pairs / predict_pairs_dataframe raise UnsupportedAllele on the
first allele the predictor cannot score, failing the whole batch. Callers
scoring a mixed set of alleles (some outside an older tool's supported
list) had to pre-filter or drop to per-allele loops.

Add skip_unsupported=False. When True, score the supported pairs and skip
the rest: predict_pairs leaves an unsupported pair as None (length and
order preserved); predict_pairs_dataframe omits its row. The skipped
alleles are logged at WARNING. Default behavior (raise) is unchanged.

Refactor _resolve_supported_allele_cli_names into a non-raising
_partition_supported_allele_cli_names plus the raising wrapper.

Claude-Session: https://claude.ai/code/session_01SZZUQruWNznzAJSN4FpDGs
@iskandr
iskandr merged commit 0da1658 into master Jul 11, 2026
5 checks passed
@iskandr
iskandr deleted the skip-unsupported-pairs branch July 11, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

predict_pairs: add skip_unsupported option so one unsupported allele doesn't fail the whole batch

1 participant