Repository navigation
Look up NCIT codes by obo_id, as NCIT.m does - #15
Merged
Merged
Conversation
NCITProvider inherited OLSProvider.lookup_term, which sends any non-numeric term to a label search. NCIT codes (C3262) are not numeric, so a lookup by code never resolved, while a lookup by name did, the reverse of MATLAB: NCIT.m always searches obo_id for ['NCIT:', search_query]. Override lookup_term to send the same query. Fixes #13. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CgkxUSKbSBq9Js9q871BNE
This was referenced Oct 21, 2026
stevevanhooser
pushed a commit
that referenced
this pull request
Oct 21, 2026
…ed helpers main brought #14 (EMPTY), #15 (NCIT codes by obo_id), #17 (lookup trimming, the same fix as this branch's) and #18 (known_gaps). #15's NCITProvider.lookup_term called OLSProvider._search_ols, which this branch replaces; git merged it cleanly, and every NCIT lookup would have raised AttributeError. It now does what NCIT.m does on the ported helpers: preprocessLookupInput, then searchOLSAndPerformIRILookup on obo_id for ['NCIT:', search_query]. Its tests move to FakeOLS, plus one for the prefixed and numeric forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017iFBFMQmEZaz21d9ZFJbiH
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.
Fixes #13.
Change
NCITProviderinheritedOLSProvider.lookup_term, which sends any term that isn't all digits to a label search. NCIT codes such asC3262aren't all digits, so a lookup by code never resolved, while a lookup by name did. MATLAB does the reverse.NCIT.m(8e109b0) runspreprocessLookupInputand then always callssearchOLSAndPerformIRILookup(['NCIT:',search_query], 'obo_id', ...).NCITProvider.lookup_termnow builds the query the waypreprocessLookupInputdoes and sendsNCIT:<query>as an exactobo_idsearch:C3262resolves toNCIT:C3262/ Neoplasm.Neoplasmis searched as the obo_idNCIT:Neoplasmand is not found, matching MATLAB. NCIT name lookup should be added toNCIT.mfirst if it's wanted.NCIT:NCIT:<digits>).The bridge entry for NCIT records the re-examination at 8e109b0.
known_gaps
Waltham-Data-Science/ndi-ontology-matlab#13 has merged (36d7814). It added SNOMED, EFO and NCIT cases to the shared table, so the second commit here empties
known_gapsintest_case_table_covers_every_ported_provider. Every ported provider now has a case.Tests
TestOLSProvidercheck that a code goes to an exactobo_idsearch forNCIT:C3262, and that a name goes to theobo_idsearch rather than a label search.black --check,ruff checkandpytest -m "not live"all pass.test_case_table_covers_every_ported_providerpasses against ndi-ontology-matlab 36d7814.main, which now includes theNCIT:C3262andNCIT:C12434rows, so that job is the live check of this fix.🤖 Generated with Claude Code
https://claude.ai/code/session_01CgkxUSKbSBq9Js9q871BNE