Skip to content
Snippets Groups Projects
Commit a11c93e9 authored by Manuel Günther's avatar Manuel Günther
Browse files

Applied new command line option strategy

parent 9fc97be0
No related branches found
No related tags found
No related merge requests found
......@@ -220,9 +220,9 @@ def verify(args, command_line_parameters, external_fake_job_id = 0):
return {}
else:
# add jobs
submitter = base_tools.GridSubmission(args, command_line_parameters, executable = 'verify_gmm.py', first_fake_job_id = 0) if args.grid else None
submitter = base_tools.GridSubmission(args, command_line_parameters, executable = 'verify_gmm.py', first_fake_job_id = 0)
retval = tools.add_jobs(args, submitter, local_job_adder = add_gmm_jobs)
base_tools.write_info(args, command_line_parameters)
base_tools.write_info(args, command_line_parameters, submitter.executable)
if args.grid.is_local() and args.run_local_scheduler:
if args.dry_run:
......@@ -237,11 +237,11 @@ def verify(args, command_line_parameters, external_fake_job_id = 0):
return retval
def main(command_line_parameters = sys.argv):
def main(command_line_parameters = None):
"""Executes the main function"""
try:
# do the command line parsing
args = parse_arguments(command_line_parameters[1:])
args = parse_arguments(command_line_parameters)
# perform face verification test
verify(args, command_line_parameters)
......
......@@ -146,9 +146,9 @@ def verify(args, command_line_parameters, external_fake_job_id = 0):
return {}
else:
# add jobs
submitter = base_tools.GridSubmission(args, command_line_parameters, executable = 'verify_isv.py', first_fake_job_id = 0) if args.grid else None
submitter = base_tools.GridSubmission(args, command_line_parameters, executable = 'verify_isv.py', first_fake_job_id = 0)
retval = tools.add_jobs(args, submitter, local_job_adder = add_isv_jobs)
base_tools.write_info(args, command_line_parameters)
base_tools.write_info(args, command_line_parameters, submitter.executable)
if args.grid.is_local() and args.run_local_scheduler:
if args.dry_run:
......@@ -163,11 +163,11 @@ def verify(args, command_line_parameters, external_fake_job_id = 0):
return retval
def main(command_line_parameters = sys.argv):
def main(command_line_parameters = None):
"""Executes the main function"""
try:
# do the command line parsing
args = parse_arguments(command_line_parameters[1:])
args = parse_arguments(command_line_parameters)
# perform face verification test
verify(args, command_line_parameters)
......
......@@ -197,9 +197,9 @@ def verify(args, command_line_parameters, external_fake_job_id = 0):
return {}
else:
# add jobs
submitter = base_tools.GridSubmission(args, command_line_parameters, executable = 'verify_ivector.py', first_fake_job_id = 0) if args.grid else None
submitter = base_tools.GridSubmission(args, command_line_parameters, executable = 'verify_ivector.py', first_fake_job_id = 0)
retval = tools.add_jobs(args, submitter, local_job_adder = add_ivector_jobs)
base_tools.write_info(args, command_line_parameters)
base_tools.write_info(args, command_line_parameters, submitter.executable)
if args.grid.is_local() and args.run_local_scheduler:
if args.dry_run:
......@@ -214,11 +214,11 @@ def verify(args, command_line_parameters, external_fake_job_id = 0):
return retval
def main(command_line_parameters = sys.argv):
def main(command_line_parameters = None):
"""Executes the main function"""
try:
# do the command line parsing
args = parse_arguments(command_line_parameters[1:])
args = parse_arguments(command_line_parameters)
# perform face verification test
verify(args, command_line_parameters)
......
......@@ -3,7 +3,6 @@ from __future__ import print_function
import bob.measure
import os
import sys
import shutil
import tempfile
import numpy
......@@ -24,7 +23,7 @@ data_dir = pkg_resources.resource_filename('bob.bio.gmm', 'test/data')
def _verify(parameters, test_dir, sub_dir, ref_modifier="", score_modifier=('scores',''), executable = main):
try:
executable([sys.argv[0]] + parameters)
executable(parameters)
# assert that the score file exists
score_files = [os.path.join(test_dir, sub_dir, 'Default', norm, '%s-dev%s'%score_modifier) for norm in ('nonorm', 'ztnorm')]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment