def _transpose(self, path): """ Generate an equivalent `pretty` path for the given `ugly` file path. :param path: the ugly path to transpose to a pretty path :type path: string :return: pretty path :rtype: string """ new_path = mkpath(self.pretty, mkrel(path, self.ugly)) self.logger.debug("Transposed {} to {}".format(path, new_path)) return new_path
def __init__(self, name): """ Create a new specimen set based around a given name. :param name: name used to locate the .docx file and name related experiments. :type name: string """ self.name = name self.logger = logging.getLogger('SPEC: ' + self.name) self.path = specimens_abs(self.name) self.logger.debug("Path set to {}".format(self.path)) self.docx = mkpath(self.path, self.name+'.docx') self.logger.debug("Docx set to {}".format(self.docx)) self.ugly = mkpath(self.path, 'ugly') self.logger.debug("Ugly directory set to {}".format(self.ugly)) self.pretty = mkpath(self.path, 'pretty') self.logger.debug("Pretty directory set to {}".format(self.pretty)) self.uglies = ls(self.ugly) self.logger.debug("Ugly files set to {}".format(self.uglies)) self.pretties = [self._transpose(path) for path in self.uglies] self.logger.debug("Pretty files set to {}".format(self.pretties))
def __init__(self, name): """ Create a new specimen set based around a given name. :param name: name used to locate the .docx file and name related experiments. :type name: string """ self.name = name self.logger = logging.getLogger('SPEC: ' + self.name) self.path = specimens_abs(self.name) self.logger.debug("Path set to {}".format(self.path)) self.docx = mkpath(self.path, self.name + '.docx') self.logger.debug("Docx set to {}".format(self.docx)) self.ugly = mkpath(self.path, 'ugly') self.logger.debug("Ugly directory set to {}".format(self.ugly)) self.pretty = mkpath(self.path, 'pretty') self.logger.debug("Pretty directory set to {}".format(self.pretty)) self.uglies = ls(self.ugly) self.logger.debug("Ugly files set to {}".format(self.uglies)) self.pretties = [self._transpose(path) for path in self.uglies] self.logger.debug("Pretty files set to {}".format(self.pretties))
def _exp(self, f): path = mkpath(self.path, f) self.logger.debug("Exp path requested: {}".format(path)) return path
def _right(self, f): path = mkpath(self.right.pretty, f) self.logger.debug("Right path requested: {}".format(path)) return path
def _left(self, f): path = mkpath(self.left.pretty, f) self.logger.debug("Left path requested: {}".format(path)) return path
def _make_report_path(self, exp_dir, filename): report_path = "{}__{}.xml".format( filename.replace("/", "__").replace(".", "_"), self.label ) return mkpath(exp_dir, report_path)