Eliminate duplicate UMLS type warnings#565
Merged
Conversation
This is because the same CURIE can have multiple entries in MRCONSO. We now keep track of the CURIEs being found, and to only print a warning if we haven't seen this CURIE before.
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces noisy duplicate logging when processing UMLS MRCONSO entries by deduplicating “no type” / “multiple types” messages per CURIE, and standardizes this module’s logging to use the repo’s get_logger() helper.
Changes:
- Introduces per-CURIE tracking sets to avoid emitting repeated “no UMLS type” / “multiple UMLS types” messages for duplicate MRCONSO rows.
- Replaces
logging.*calls with a module-levellogger = get_logger(__name__). - Adjusts log levels/messages and end-of-run summaries to report unique CURIE counts.
Comments suppressed due to low confidence (1)
src/createcompendia/leftover_umls.py:129
umls_type_to_biolink_typeis defined inside the MRCONSO line loop, so it gets re-created for every MRCONSO row. Since it only depends onbiolink_toolkit, it can be defined once (outside the loop) to reduce overhead and keep the loop body simpler.
logger.debug(f"UMLS ID {umls_id} has already been included in this compendium, skipping.")
continue
# The STR value should be the label.
label = x[14]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gaurav
commented
Mar 3, 2026
….info call Converts the remaining `logging.info()` call (missed in the original PR) to `logger.info()` and removes the now-unused `import logging`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gaurav
commented
Mar 30, 2026
…er_umls MRCONSO can have many rows per CUI. CURIEs skipped due to type resolution failure (no type or multiple types) were not being short-circuited on subsequent rows, causing repeated biolink_toolkit lookups. Add an early continue once a CURIE has already been evaluated and skipped. Co-Authored-By: Claude Sonnet 4.6 <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.
This PR fixes duplicate log/report entries in leftover_umls.py. Because the same CURIE can appear multiple times in MRCONSO, warnings and report lines for NO_UMLS_TYPE and MULTIPLE_UMLS_TYPES were being emitted once per MRCONSO row rather than once per CURIE. The fix tracks seen CURIEs in sets and skips repeated log/report writes. It also migrates all logging.xxx calls to a module-level
logger = get_logger(__name__).Also includes some unrelated
uv.lockversion changes and some Snakemake file reformatting that really should have been fixed elsewhere >.<