Add organism classification (acellular/unicellular/multicellular) for assay metadata#2381
Closed
SatoryKono wants to merge 1 commit intomainfrom
Closed
Add organism classification (acellular/unicellular/multicellular) for assay metadata#2381SatoryKono wants to merge 1 commit intomainfrom
SatoryKono wants to merge 1 commit intomainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
Author
|
Superseded by #2380. |
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.
Motivation
assay_organismиassay_taxonomy_idс приоритетом taxonomy_id и диагностикой конфликтов.Description
src/bioetl/domain/mapping/organism_classification.py, экспортируемый черезbioetl.domain.mapping, реализующий:OrganismClass(Enum) с членамиACELLULAR,UNICELLULAR,MULTICELLULAR;OrganismClassificationResult(frozen dataclass) с полямиorganism_class,normalized_organism,taxonomy_id,source,source_conflict,reason;classify_organism(assay_organism, assay_taxonomy_id)с приоритетомtaxonomy_idи явным указанием причины/конфликта;normalize_organism_name(trim, lower, remove parenthetical fragments, collapse spaces);TAXONOMY_CLASS_MAP,ORGANISM_ALIAS_MAPиORGANISM_NAME_CLASS_MAPи правило ключевых слов для эвристики (штаммы/изолят, ключевые слова virus/bacter/etc.).src/bioetl/domain/mapping/__init__.py, добавлены экспортыOrganismClass,OrganismClassificationResult,classify_organism,normalize_organism_name.tests/unit/domain/mapping/test_organism_classification.py, покрывающие: классификацию по taxonomy_id, классификацию по имени (включая штаммы), алиасы (hiv,rice,eel,monkey), поведение при конфликте и невалидный/пустой ввод.Testing
uv run python -m pytest tests/unit/domain/mapping/test_organism_classification.py -q✅.uv run python -m pytest tests/ -x -q— failed due to pre-existing repository formatting checks (ruff) detecting an unrelated test file that needs formatting (tests/unit/infrastructure/config/test_contract_policy_loader.py) (failure is unrelated to the new mapping logic) ❌.uv run python -m mypy --strict src/bioetl/— reported pre-existing mypy issues in unrelated files (src/bioetl/__init__.py,src/bioetl/infrastructure/config/contract_policy_loader.py,src/bioetl/infrastructure/system/memory_monitor.py), so strict type-check for entire repo did not pass (these are existing errors) ❌.ruff formatto the new files during the rollout; new module now adheres to ruff checks.If desired, next steps: expand the taxonomy mapping table and aliases from a config file or reference CSV, and follow-up PRs can address the unrelated formatting/mypy issues that block full-suite gates.
Codex Task