Add predict_pairs(skip_unsupported=True) (#263) - #264
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #263.
predict_pairs/predict_pairs_dataframeraiseUnsupportedAlleleon 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. WhenTrue, score the supported pairs and skip the rest:predict_pairsleaves an unsupported pair asNone; the list length and order are preserved, so results still align 1:1 with the input.predict_pairs_dataframeomits the unsupported rows (the frame can be shorter than the input).Default behavior is unchanged: with
skip_unsupported=Falsean unsupported allele still raisesUnsupportedAllelebefore any command runs.Internally,
_resolve_supported_allele_cli_namesis 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 returnsNonein 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