def _op_init_pending_run(op, run_dir): run_dir = run_dir or op.run_dir run = op_util.init_run(run_dir) log.debug("initializing run in %s", run.dir) run.init_skel() op_util.set_run_pending(run) return run
def _init_trial_run(batch_run, trial_flag_vals, run_dir=None): run = op_util.init_run(run_dir) _link_to_trial(batch_run, run) proto_run = batch_run.batch_proto util.copytree(proto_run.dir, run.dir) run.write_attr("flags", trial_flag_vals) run.write_attr("label", _trial_label(proto_run, trial_flag_vals)) run.write_attr("op", _trial_op_attr(proto_run, trial_flag_vals)) op_util.set_run_staged(run) return run
def init_trial_run(batch_run, trial_flag_vals, run_dir=None): run = op_util.init_run(run_dir) _link_to_trial(batch_run, run) proto_run = batch_run.batch_proto assert proto_run, "proto_run not initialized for batch %s (%s)" % ( batch_run.id, batch_run.dir, ) util.copytree(proto_run.dir, run.dir) run.write_attr("flags", trial_flag_vals) run.write_attr("label", _trial_label(proto_run, trial_flag_vals)) run.write_attr("op", _trial_op_attr(proto_run, trial_flag_vals)) op_util.set_run_staged(run) return run