def dag_path(cls, conf, args, ext="pickle"): dirname = cls._arg_dirname(cls._output_dir(conf), cls.jobname(args)) # try <- compatibility try: common.mkdir(dirname) except OSError: return return dirname + "/dag.{0}".format(ext)
def evdef_path(cls, args): conf, dt_range, area = args dirname = cls._arg_dirname(cls._output_dir(conf), cls.jobname(args)) # try <- compatibility try: common.mkdir(dirname) except OSError: return return dirname + "/evdef.pickle"
def evdef_path_old(cls, args): conf, dt_range, area = args dirname = conf.get("dag", "evmap_dir") filename = cls.jobname(args) if dirname == "": dirname = conf.get("dag", "output_dir") filename = filename + "_def" else: common.mkdir(dirname) return "{0}/{1}".format(dirname, filename)
def _init_trial_info(self): common.mkdir(self._output_dir_trial(self._conf)) if self._n_trial is None: return assert self._n_trial < 10 ** self.FILEPATH_DIGIT_LENGTH self._d_trial = {"params": self._params, "l_tid": list(), "n_c_lines": int(), "d_n_c_lines": defaultdict(int), "n_c_words": int(), "d_n_c_words": defaultdict(int), }
def __init__(self, conf): self._conf = conf output_dir = self._output_dir(conf) common.mkdir(output_dir) self.args_path = "{0}/{1}".format(output_dir, self._args_filename) self.l_args = []
def dag_path_old(cls, args): conf, dt_range, area = args dirname = conf.get("dag", "output_dir") common.mkdir(dirname) filename = cls.jobname(args) return "{0}/{1}".format(dirname, filename)
def dump(self): output_dir = self._output_dir(self._conf) common.mkdir(output_dir) with open(self._arglist_path(self._conf), 'w') as f: f.write("\n".join([self.jobname(args) for args in self.l_args]))