Skip to content

Commit

Permalink
issue #49 - results file by query name
Browse files Browse the repository at this point in the history
  • Loading branch information
melanie-fressard committed Nov 20, 2023
1 parent 68cf448 commit 3c38ab7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bin/search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
import sys
import json
import logging
import ailab.db.api as api
import ailab.db as db
Expand Down Expand Up @@ -33,6 +34,7 @@ def init_bench(query):
How to execute: python3 -m search.py query"""
query = " ".join(sys.argv[1:])
logging.debug(f"Query is: {query}")
init_bench(query)
with open(OUTFILE, "r") as result_file:
print(pd.read_json(result_file, lines=True))
results = init_bench(query)
query_file_name = query.replace (" ", "-") + ".json"
with open('tests/output/' + query_file_name, 'w+') as result_file:
json.dump(results, result_file)
Loading

0 comments on commit 3c38ab7

Please sign in to comment.