Skip to content

Commit

Permalink
removed dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
cbizon committed Jul 13, 2023
1 parent 2f9a2ab commit 4c1a04c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion openapi-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ servers:
# url: http://127.0.0.1:5000
termsOfService: http://robokop.renci.org:7055/tos?service_long=ARAGORN&provider_long=RENCI
title: ARAGORN
version: 2.4.13
version: 2.4.14
tags:
- name: translator
- name: ARA
Expand Down
23 changes: 9 additions & 14 deletions src/service_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,8 @@ async def check_for_messages(guid, num_queries, num_previously_received=0):
num_responses += 1
logger.info(f"{guid}: Strider returned {num_responses} out of {num_queries}.")
jr = process_message(message)
with open(f"{guid}_{num_responses}.json","w") as outf:
json.dump(jr,outf,indent=2)
#with open(f"{guid}_{num_responses}.json","w") as outf:
# json.dump(jr,outf,indent=2)
if is_end_message(jr):
logger.info(f"{guid}: Received complete message from multistrider")
complete = True
Expand Down Expand Up @@ -914,10 +914,10 @@ async def robokop_infer(input_message, guid, question_qnode, answer_qnode):
max_conns = os.environ.get("MAX_CONNECTIONS", 5)
nrules = int(os.environ.get("MAXIMUM_ROBOKOPKG_RULES", 101))
messages = expand_query(input_message, {}, guid)
with open('robokop_infer.txt', 'w') as logfile:
json.dump(input_message, logfile, indent=2)
logfile.write("------\n")
json.dump(messages, logfile, indent=2)
#with open('robokop_infer.txt', 'w') as logfile:
# json.dump(input_message, logfile, indent=2)
# logfile.write("------\n")
# json.dump(messages, logfile, indent=2)
lookup_query_graph = messages[0]["message"]["query_graph"]
logger.info(f"{guid}: {len(messages)} to send to {automat_url}")
result_messages = []
Expand All @@ -940,9 +940,9 @@ async def robokop_infer(input_message, guid, question_qnode, answer_qnode):
num_results = len(rmessage["message"].get("results",[]))
logger.info(f"Returned {num_results} results")
if num_results > 0 and num_results < 10000: #more than this number of results and you're into noise.
with (open(f"{guid}_r_{nr}.json", 'w')) as outf:
json.dump(rmessage, outf, indent=2)
nr += 1
#with (open(f"{guid}_r_{nr}.json", 'w')) as outf:
# json.dump(rmessage, outf, indent=2)
# nr += 1
result_messages.append(rmessage)
else:
logger.error(f"{guid}: {response.status_code} returned.")
Expand Down Expand Up @@ -1041,9 +1041,6 @@ async def omnicorp(message, params, guid) -> (dict, int):
"""
url = f'{os.environ.get("RANKER_URL", "https://aragorn-ranker.renci.org/1.4/")}omnicorp_overlay'

with open("to_corp.json","w") as f:
f.write(json.dumps(message,indent=2))

rval, omni_status = await subservice_post("omnicorp", url, message, guid)

# Omnicorp is not strictly necessary. When we get something other than a 200,
Expand All @@ -1060,8 +1057,6 @@ async def score(message, params, guid) -> (dict, int):
:param guid:
:return:
"""
with open("to_score.json","w") as f:
f.write(json.dumps(message,indent=2))

ranker_url = os.environ.get("RANKER_URL", "https://aragorn-ranker.renci.org/1.4/")

Expand Down

0 comments on commit 4c1a04c

Please sign in to comment.