Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: monarch-initiative/curategpt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: EBISPOT/curategpt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 12, 2025

  1. Add aliases

    aleixpuigb committed Mar 12, 2025
    Copy the full SHA
    1efc16a View commit details
  2. Copy the full SHA
    70359e0 View commit details
Showing with 4 additions and 1 deletion.
  1. +1 −1 Makefile
  2. +3 −0 src/curategpt/wrappers/ontology/ontology_wrapper.py
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ index_all_ont: $(patsubst %,ont-%,$(ONTS))
index_all_issues: $(patsubst %,load-github-%,$(ONTS))

ont-%:
$(CURATE) ontology index --index-fields label,definition,relationships -p $(DB_PATH) -c ont_$* -m openai: sqlite:obo:$*
$(CURATE) ontology index --index-fields label,definition,relationships,aliases -p $(DB_PATH) -c ont_$* -m openai: sqlite:obo:$*

## -- Web App --

3 changes: 3 additions & 0 deletions src/curategpt/wrappers/ontology/ontology_wrapper.py
Original file line number Diff line number Diff line change
@@ -93,6 +93,8 @@ def objects(
# as may be used in references
labels = {e: lbl for e, lbl in adapter.labels(entities, allow_none=False)}
logger.info(f"Found {len(labels)} labels")
aliases = {e: adapter.entity_aliases(e) for e in entities}
logger.info(f"Found {len(aliases)} sets of aliases")
definitions = {}
if self.fetch_definitions:
for chunked_entities in chunk(selected_ids, 100):
@@ -127,6 +129,7 @@ def objects(
obj = OntologyClass(
id=shorthand,
label=labels[id],
aliases=aliases[id],
original_id=id,
aliases=aliases_by_entity.get(id, []),
)