Skip to content

Commit

Permalink
remove debugging stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
uhbrar committed Sep 6, 2024
1 parent 214e3b7 commit 393e17a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/pathfinder/get_cooccurrence.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@ def get_the_pmids(curies: List[str]):
port=6379,
db=0
)
start = time.time()
curie_pmids = []
for curie in curies:
pmids = r.get(curie)
if pmids is None:
pmids = []
else:
pmids = json.loads(gzip.decompress(pmids))
# print(len(pmids))
curie_pmids.append(pmids)
answer = list(set.intersection(*map(set, curie_pmids)))
end = time.time()
# print(f"Got back {len(answer)} pmids in {end - start} seconds.")
return answer

def get_the_curies(pmid: str):
Expand All @@ -33,18 +29,10 @@ def get_the_curies(pmid: str):
port=6379,
db=1
)
start = time.time()
curies = r.get(pmid)
if curies is None:
curies = []
else:
curies = json.loads(gzip.decompress(curies))
answer = list(curies)
end = time.time()
# print(f"Got back {len(answer)} curies in {end - start} seconds.")
return answer


if __name__ == "__main__":
print(len(get_the_pmids(["MONDO:0004979"])))
print(len(get_the_pmids(["CHEBI:45783"])))

0 comments on commit 393e17a

Please sign in to comment.