Skip to content

Commit

Permalink
add strict=True to converter.expand for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
glass-ships committed Dec 7, 2023
1 parent f567ae0 commit 95beb1b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions backend/src/monarch_py/api/config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import os
import requests as rq

from functools import lru_cache

from pydantic import BaseModel

# from pydantic_settings import BaseSettings

from monarch_py.implementations.solr.solr_implementation import SolrImplementation
Expand Down
2 changes: 1 addition & 1 deletion backend/src/monarch_py/service/curie_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ def initialize(self):
self.converter = load_converter(["merged"])

def expand(self, curie: str) -> str:
return self.converter.expand(curie)
return self.converter.expand(curie, strict=True)
9 changes: 5 additions & 4 deletions backend/tests/unit/test_curie_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@
), # this is a little odd, fb vs. flybase, but both resolve
("FlyBase:FBgn0000008", "http://identifiers.org/fb/FBgn0000008"),
("MONDO:0005737", "http://purl.obolibrary.org/obo/MONDO_0005737"),
("OMIM:613647", "http://identifiers.org/mim/613647"),
("NCBIGene:1017", "https://identifiers.org/ncbigene/1017"),
("ZFIN:ZDB-GENE-980526-166", "https://identifiers.org/zfin/ZDB-GENE-980526-166"),
("MGI:1918910", "https://identifiers.org/MGI/1918910"),
("ENSEMBL:ENSG00000157764", "http://identifiers.org/ensembl/ENSG00000157764"),
("HP:0000001", "http://purl.obolibrary.org/obo/HP_0000001"),
("UBERON:0000001", "http://purl.obolibrary.org/obo/UBERON_0000001"),
("GO:0000001", "http://purl.obolibrary.org/obo/GO_0000001"),
("CL:0000001", "http://purl.obolibrary.org/obo/CL_0000001"),
("WormBase:WBGene00000001", "http://identifiers.org/wb/WBGene00000001"),
("WB:WBGene00000001", "https://identifiers.org/wb/WBGene00000001"),
("SGD:S000000001", "https://identifiers.org/sgd/S000000001"),
("RGD:1", "https://identifiers.org/rgd/1"),
("HGNC:5", "http://identifiers.org/hgnc/5"),
### These prefixes are currently broken in the curie service
("ENSEMBL:ENSG00000157764", "http://identifiers.org/ensembl/ENSG00000157764"),
("OMIM:613647", "http://identifiers.org/mim/613647"),
("UBERON:0000001", "http://purl.obolibrary.org/obo/UBERON_0000001"),
("WormBase:WBGene00000001", "http://identifiers.org/wb/WBGene00000001"),
],
)
def test_curie_expansion(curie, expanded_curie_part):
Expand Down

0 comments on commit 95beb1b

Please sign in to comment.