Commit 7cc4b4a4 authored by Mateusz Pawlik's avatar Mateusz Pawlik

Removed obsolete arguments and added debug mode.

parent de2a6d33
......@@ -22,7 +22,7 @@ from datetime import datetime
# TODO: Fix the paths depending on where is the script executed from.
# Everything is executed from the project's root.
binary_name = "build/ted-algs-experiments"
algorithms_repository_path = "external/tree-similarity-private/"
algorithms_repository_path = "external/tree-similarity/"
# execute a command and return stdout
def get_stdout_cmd(callargs):
......@@ -119,6 +119,11 @@ parser.add_argument(
dest='config_filename',
help="Path to experiments config file."
)
parser.add_argument(
type=str,
dest='dataset_path',
help="Path to the root directory of the datasets (with trailing slash)."
)
parser.add_argument(
type=str,
dest='service_name',
......@@ -130,6 +135,12 @@ parser.add_argument(
action = 'store_true',
help = 'Set to store results in the database (default: not set).'
)
parser.add_argument(
'--debug',
dest = 'debug',
action = 'store_true',
help = 'Set to print experiments commands that will be executed (default: not set).'
)
args = parser.parse_args()
# Fixed values for this execution - passed to all algorithms.
......@@ -161,7 +172,7 @@ for a in data['algorithms']:
"dataset_filename" : filename
})
print("EXECUTING: " + filename + ";" + a + ";" + str(t))
if args.store:
if args.store and not args.debug:
new_params_id = store_ted_experiment_params(args.service_name, ted_experiment_params)
# build command that needs to be executed
......@@ -179,14 +190,20 @@ for a in data['algorithms']:
# TODO: Verify if an experiment like that has been already executed
# and how many values it has.
cmd_output = get_stdout_cmd(cmd).strip()
result_data = json.loads(cmd_output.decode('utf-8'))
cmd_output = ""
result_data = []
if args.debug:
print(cmd)
else:
cmd_output = get_stdout_cmd(cmd).strip()
result_data = json.loads(cmd_output.decode('utf-8'))
if not args.store:
if not args.store and not args.debug:
print("RESULTS:")
print(cmd_output)
if args.store:
if args.store and not args.debug:
print("STORING ...")
store_multirow_results(
args.service_name,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment