Skip to content

Feat/us6.1 mapping utility#19

Open
ecarrenolozano wants to merge 31 commits intomainfrom
feat/us6.1-mapping-utility
Open

Feat/us6.1 mapping utility#19
ecarrenolozano wants to merge 31 commits intomainfrom
feat/us6.1-mapping-utility

Conversation

@ecarrenolozano
Copy link
Member

@ecarrenolozano ecarrenolozano commented Sep 11, 2025

This pull request introduces a new mapping lookup table (LUT) feature for ontology term translation, along with supporting utilities, API methods, and a demonstration notebook. It also updates pre-commit hooks and adds a new dependency. These changes make it easier to map and work with ontology terms across different databases.

Mapping LUT Feature and Utilities:

  • Added a new MappingLUT class to represent mapping lookup tables for ontology IDs and database names, with utility methods for accessing mappings and database lists (ontograph/models.py).
  • Implemented utility functions for reading mapping files, creating reverse mapping dictionaries, and translating term IDs using a LUT (ontograph/utils.py).

Client API Enhancements:

  • Added methods to ClientOntology for loading mapping files, retrieving mapping LUTs, listing database names, and batch term retrieval (ontograph/client.py). [1] [2] [3] [4]
  • Updated the ontology navigator to support batch retrieval of term objects and improved error handling (ontograph/queries/navigator.py).

Demonstration and Documentation:

  • Added a new notebook chebi_mix_ontology.ipynb demonstrating the mapping LUT workflow and use cases.

Dependency and Tooling Updates:

  • Added pandas as a dependency for mapping file operations (pyproject.toml).
  • Updated pre-commit hook versions for ruff-pre-commit, pre-commit-hooks, and blacken-docs in .pre-commit-config.yaml. [1] [2] [3]

@ecarrenolozano ecarrenolozano added the enhancement New feature or request label Sep 11, 2025
@ecarrenolozano ecarrenolozano marked this pull request as ready for review September 11, 2025 23:29
Copilot AI review requested due to automatic review settings September 11, 2025 23:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces a new mapping lookup table (LUT) feature for ontology term translation, enabling easier mapping and translation of ontology terms across different databases. The implementation includes comprehensive testing, utility functions, and API enhancements to support the new functionality.

  • Adds MappingLUT class and utilities for reading mapping files and creating reverse mapping dictionaries
  • Enhances ClientOntology with methods for loading mapping files, retrieving LUTs, and batch term retrieval
  • Updates pre-commit hook versions and adds pandas dependency

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
ontograph/utils.py Core utilities for reading mapping files, creating reverse mappings, and translating term IDs
ontograph/models.py New MappingLUT class to represent mapping lookup tables
ontograph/client.py Client API enhancements for mapping operations and batch term retrieval
ontograph/queries/navigator.py Updated navigator to support batch term retrieval with improved error handling
tests/test_utils.py Comprehensive test suite for utility functions
tests/test_models.py Test coverage for the new MappingLUT class
pyproject.toml Adds pandas dependency
notebooks/chebi_mix_ontology.ipynb Demonstration notebook showing mapping LUT workflow
.pre-commit-config.yaml Updates pre-commit hook versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants