def parse_custom_args(): ARGPARSER.description = USAGE ARGPARSER.add_argument('--rev', dest='revision', help='Fast Downward revision or "baseline". If omitted use current revision.') ARGPARSER.add_argument('--test', choices=['nightly', 'weekly'], default='nightly', help='Select whether "nightly" or "weekly" tests should be run.') return ARGPARSER.parse_args()
def parse_args(): ARGPARSER.add_argument("--tex", action="store_true", help="produce LaTeX output") ARGPARSER.add_argument("--relative", action="store_true", help="make relative scatter plots") return ARGPARSER.parse_args()
def parse_args(): ARGPARSER.add_argument( "--test", choices=["yes", "no", "auto"], default="auto", dest="test_run", help="test experiment locally on a small suite if --test=yes or " "--test=auto and we are not on a cluster") return ARGPARSER.parse_args()
def generate_problemlist_api_on(args): """ """ problem_list = {} domain_col_map = dict([]) # Fetch collections c_list = [] if (args.BNAME and len(args.BNAME) > 0): for b in args.BNAME: c_list.extend(api.find_collections(b)) if (len(c_list) == 0): ARGPARSER.error("Collection not found") else: c_list = api.get_collections() # Fetch domains d_list = [] if (args.DNAME and len(args.DNAME) > 0): for d in args.DNAME: d_list.extend([ x['domain_id'] for x in api.find_domains(d) if x['domain_name'] == d ]) if (len(d_list) == 0): ARGPARSER.error("Domain not found") # Link collection with domain for c in c_list: for d in c['domain_set'].strip('[]').split(','): if ((not args.DNAME) or (int(d) in d_list)): domain_col_map.setdefault(int(d), []).append(c['collection_id']) # filter based on PNAME or select all problems in domain_col_map p_list = [] if (args.PNAME and len(args.PNAME) > 0): for prob in args.PNAME: p_list.extend([ p for p in api.find_problems(prob) if (domain_col_map.get(p['domain_id'], None) and ( (args.OPT and not re.search( r'sat', basename(dirname(p['domain_path'])))) or (args.SAT and not re.search( r'opt', basename(dirname(p['domain_path'])))) or (not args.OPT and not args.SAT))) ]) if (len(p_list) == 0): ARGPARSER.error("Problem not found") else: for k, _ in domain_col_map.items(): p_tmp = api.get_problems(k) if ((args.OPT and not re.search( r'sat', basename(dirname(p_tmp[0]['domain_path'])))) or (args.SAT and not re.search( r'opt', basename(dirname(p_tmp[0]['domain_path'])))) or (not args.OPT and not args.SAT)): p_list.extend(p_tmp) #Setup experiments for all solvers #if os.path.isdir('./temp'): # shutil.rmtree('./temp') for p in p_list: prob = {} bname = ",".join([ api.get_collection(x)['collection_name'] for x in domain_col_map[p['domain_id']] ]) prob['domain_url'] = p['domain_url'] prob['domain_file'] = re.sub( abspath(args.REPO_PATH) + '/', '', abspath(p['domain_path'])) prob['problem_url'] = p['problem_url'] print(p['problem_path']) if (args.ATOMIC): pfiles_atomic = split_atomic_goals(p['problem_path'], p['domain'], str(p['domain_id']), p['problem']) for p_path in pfiles_atomic: prob['problem_file'] = re.sub( abspath(args.REPO_PATH) + '/', '', abspath(p_path)) prob['problem'] = ".".join( basename(prob['problem)file']).split('.')[:-1]) #problem_list.append(copy.deepcopy(prob)) #problem_list.setdefault(bname,{}).setdefault(p['domain'], #[]).append(copy.deepcopy(prob)) else: prob['problem_file'] = re.sub( abspath(args.REPO_PATH) + '/', '', abspath(p['problem_path'])) pname_tmp = ".".join( basename(prob['problem_file']).split('.')[:-1]) #problem_list.append(copy.deepcopy(prob)) prob['tag'] = "null" problem_list.setdefault(basename(dirname(prob['problem_file'])), {}).setdefault( tuple(bname.split(',')), {})[pname_tmp] = copy.deepcopy(prob) for d, b in problem_list.items(): for bname, plist in b.items(): new_plist = {} for pname in sorted(plist.keys()): new_plist[pname] = plist[pname] b[bname] = new_plist new_problem_list = {} for d in sorted(problem_list.keys()): new_problem_list[d] = problem_list[d] return new_problem_list
action='store', default=None, help='domain name') parser.add_argument('--OUTFILE', nargs='?', action='store', default="plist.yml", help='domain name') parser.add_argument( '--REPO_PATH', nargs='?', action='store', required=True, help='path to the "classical-domain" repository of problem pddls') args = parser.parse_args() if (args.API_OFF) and (args.BPATH == None): ARGPARSER.error( "BPATH must be set if API from api.planning.domain is OFF") if (not args.API_OFF): problem_list = generate_problemlist_api_on(args) else: print("Functionality work in progress") exit() #problemt_list = generate_problemlist_api_off( args) with open(args.OUTFILE, 'w') as outfile: #YAML(typ='safe').dump(problem_list, outfile) YAML().dump(problem_list, outfile)
LOG_PARSER = 'parser/lab_parser.py' CWD = dirname(realpath(__file__)) CLR_TMP_PATH = join(CWD, Path('clear_tmp.sh')) # Define path and local system parameters NODE = platform.node() REMOTE = None #NODE.endswith( ".unimelb.edu.au") SCRIPT_DIR = dirname(abspath(__file__)) #xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx# #---- PARSE COMMAND-LINE ARGS -------------------------------------------------# with open(join(CWD, Path(CONFIG_FILE)), 'r') as fc_p: config = YAML(typ='safe').load(fc_p) ARGPARSER.add_argument('--SOLVERS', nargs='+', action='store', default=[join(CWD, Path(x)) for x in config['SOLVERS']], required=False, help='USAGE: --SOLVERS\ "<PATH-to-solver> <args>" "solver2 <args>"...') ARGPARSER.add_argument('--NUM_PROC', nargs='?', type=int, action='store', default=int(config['NUM_PROC']) if config['NUM_PROC'] else cpu_count(), help='number of processors') ARGPARSER.add_argument('--PLIST_YML', action='store', default=join(CWD, Path(config['PLIST_YML'])), nargs='?', help='yaml file with list of problems,\ check "example.json"') ARGPARSER.add_argument('--BNAME', nargs='*', action='store', default=config['BNAME'], help='benchmark dir-name') ARGPARSER.add_argument('--DNAME', nargs='*', action='store', default=config['DNAME'], help='domain name') ARGPARSER.add_argument('--PNAME', nargs='*', action='store', default=config['PNAME'], help='problem name') ARGPARSER.add_argument('--PLAN_FILE', nargs='*', action='store', default=config['PLAN_FILE'], help='domain name')