Track down the NodeNorm Biolink type changes on exp - #108
Open
gaurav wants to merge 2 commits into
Open
Conversation
Each of these four tests looped over its CURIEs and asserted per-CURIE, so the first mismatch aborted the test and hid every other difference. Tracking down what changed in NodeNorm meant fixing one expectation at a time to reveal the next. Replace the four near-identical request/compare blocks with a shared check_biolink_types() helper that collects every mismatch across every CURIE and reports them in a single assertion, distinguishing membership changes (with the missing/unexpected types called out) from pure reorderings. No expected values change here; this commit is behaviour-preserving. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Running these tests against `exp` shows three differences from the previous baseline, all consistent with a Biolink model version bump rather than a change in Babel's data: 1. `biolink:OntologyClass` is now returned for cliques that previously lacked it -- MESH:D014867 (SmallMolecule) and NCIT:C34373 (Disease) -- inserted after the second-most-specific type. It is still absent from UNII:K16AIQ8CTM (ChemicalEntity). 2. `biolink:GeneOrGeneProductOrGeneFamily` is a new type on gene cliques (NCBIGene:22059, PR:Q9Y6J0), directly after `biolink:GeneOrGeneProduct`. 3. As a consequence of (1), `biolink:OntologyClass` now arrives with the main clique's types for MESH:D014867 instead of being appended by DrugChemical conflation, so its position moves from index 10 to index 2. The membership is unchanged; only the order differs. This is the change that originally prompted this investigation. These expectations now match `exp` only: dev, prod, test and ci still return the previous baseline and so now fail with the exact inverse differences. That is deliberate -- making the tests pass everywhere would require version-conditional expectations that hide the very difference we want to decide on. Co-Authored-By: Claude Opus 4.8 (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.
uv run pytest --target exp tests/nodenorm/test_nodenorm_types.pyfails because the position ofbiolink:OntologyClasshas changed. This PR makes those failures legible and records what actually changed, so we can decide whether to accept the new values as the baseline or fix NodeNorm.1. Report every difference at once
Each of the four tests looped over its CURIEs and asserted per-CURIE, so the first mismatch aborted the test and hid the rest — tracking down the change meant fixing one expectation at a time to reveal the next.
The four near-identical request/compare blocks are now one
check_biolink_types()helper that collects every mismatch across every CURIE into a single assertion, and distinguishes a membership change (calling out which types are missing and which are unexpected) from a pure reordering:That commit is behaviour-preserving — no expected values change.
2. What changed on exp
Three differences, all consistent with a Biolink model version bump rather than a change in Babel's data:
biolink:OntologyClassnow returned where it previously wasn't, inserted after the second-most-specific typeMESH:D014867(SmallMolecule),NCIT:C34373(Disease) — but notUNII:K16AIQ8CTM(ChemicalEntity)biolink:GeneOrGeneProductOrGeneFamilyis a new type on gene cliques, directly afterbiolink:GeneOrGeneProductNCBIGene:22059,PR:Q9Y6J0biolink:OntologyClassmoves from index 10 to index 2 under DrugChemical conflationMESH:D014867(3) is the change that prompted this investigation, and it falls out of (1):
OntologyClassnow arrives with the main clique's types instead of being appended by the conflation tail. Membership is identical; only the order differs.Questions for review
MESH:D014867andNCIT:C34373gainedOntologyClass, butUNII:K16AIQ8CTMdid not.Note on other targets
The expectations now match
exponly. dev, prod, test and ci still return the previous baseline and so now fail with the exact inverse differences. That is deliberate — making the tests pass on every target would need version-conditional expectations that hide the very difference we're trying to decide on. Once exp is promoted, this should go green everywhere; if we'd rather stay on the old baseline until then, the second commit can simply be reverted.🤖 Generated with Claude Code