Repository navigation
Match jobs to a sample on the samples they name - #50
Merged
Merged
Conversation
queryJobs kept a job when its parameters, rendered as text, contained the
sample id after "(" or ",". Job.parameters joins the arguments with ", ",
so the comma forms never matched, and a sample that was not a job's first
argument was missed: the second sample of getMatchesForSampleVs, or one of
the samples of a cross compare's getMatchesForSampleVsGroup. A matching
threshold equal to the sample id could also make a job match.
Jobs are now matched on their leading positional arguments, which MCRIT
uses for the samples, while the matching knobs are passed by keyword. The
ids are compared through int(), as Job.sample_id reads them.
Closes #47
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 #47.
McritInterface.queryJobs(sample_id)kept a job whenjob.parameters, the job rendered as text, contained the sample id as(id),(id,,,id,or,id).Job.parametersjoins the arguments with", ", so the last two forms never matched. A sample that was not a job's first argument was missed:getMatchesForSampleVs(5, 23);getMatchesForSampleVsGroup(7, [5, 23]), the per-sample job a cross compare creates in MCRIT 1.15.The text test could also match on a keyword argument, for example a matching threshold equal to the sample id.
Change
_matchesSamplereads the job's method and only the leading positional arguments that name samples: 1 forgetMatchesForSample, 2 forgetMatchesForSampleVsandgetMatchesForSampleVsGroup, where the second may be a list. MCRIT passes the samples positionally and the matching knobs by keyword (MinHashIndex._submitMatchingJob, v1.15.0), andJob.argumentsreturns the positional values first. The ids are compared throughint(), asJob.sample_idreads them. The server-sidefilterfrom #39 stays as it is.The vendored
Jobclass is unchanged. It mirrors core's, whosehas_sample_iddoes not knowgetMatchesForSampleVsGroupeither, so changing only the plugin's copy would make it deviate from core.Testing
Jobobjects in the format MCRIT stores: keyword arguments by name, positional ones as"0","1", ...main(onlygetMatchesForSample(23)is found) and passes with the change.ruff format --check,ruff check, the sync checks andpython -m pytest tests(334 tests) pass.🤖 Generated with Claude Code