def __init__(self, prefix): """ Args: prefix (str): Path of the prefix """ self._prefix = prefix self.paths = paths.Paths(self._prefix) self._virt_env = None self._metadata = None
def getStreamErrors(): import paths mypaths = paths.Paths() errFile = '{}/streamErrors.txt'.format(mypaths.llh_dir) if not os.path.isfile(errFile): return [] with open(errFile, 'r') as f: badFiles = f.readlines() badFiles = [f.strip() for f in badFiles] return badFiles
def is_prefix(cls, path): """ Check if a path is a valid prefix Args: path(str): path to be checked Returns: bool: True if the given path is a prefix """ lagofile = paths.Paths(path).prefix_lagofile() return os.path.isfile(lagofile)
def main(): parameters = get_parameters() #rint_encoder_parameters(parameters) path = paths.Paths() path.set_paths(parameters) #path.print_paths() print("\n############################################################") print('---------- Creating all directories') cmd_mkdir_of_pc = 'mkdir ' + path.of_pc_lf_path cmd_mkdir_residues = 'mkdir ' + path.residues_path cmd_mkdir_yuv = 'mkdir ' + path.yuv_path cmd_mkdir_str = 'mkdir ' + path.str_path print(cmd_mkdir_of_pc) os.system(cmd_mkdir_of_pc) print(cmd_mkdir_residues) os.system(cmd_mkdir_residues) print(cmd_mkdir_yuv) os.system(cmd_mkdir_yuv) print(cmd_mkdir_str) os.system(cmd_mkdir_str) print("\n############################################################") print('---------- Encoding central SAI') central_sai_encoder.central_sai_to_yuv(parameters['-type'], path.org_lf_path, path.yuv_path) central_sai_encoder.encode_central_sai_hevc(path.org_lf_path, path.yuv_path, path.str_path, 50) matlab_engine = matlab.engine.start_matlab() print("\n############################################################") print('---------- Running OF+PC encoder') print('Command: warp_SAIs(' + parameters['-type'] + ', \'blocks\', \'median\', ' + path.org_lf_path + ', ' + path.reference_lf_path + ', ' + path.output_path + ')\n') matlab_engine.warp_SAIs(parameters['-type'], 'blocks', 'median', path.org_lf_path, path.reference_lf_path, path.of_pc_lf_path, nargout=0) print("\n############################################################") print('---------- Generating residues') print('Command: generate_residue(' + parameters['-type'] + ', ' + path.org_lf_path + ', ' + path.of_pc_lf_path + ', ' + path.residues_path + ')\n') matlab_engine.generate_residues(parameters['-type'], path.org_lf_path, path.of_pc_lf_path, path.residues_path, nargout=0) print("\n############################################################") print('---------- Generating residues YUV') ppm_to_yuv.generate_sais_list('lenslet', path.residues_path) ppm_to_yuv.generate_yuv_residues('lenslet', path.residues_path, path.yuv_path)
def __init__(self, argv): optionsparsing.Options(argv) paths.Paths() options.Options() logging.basicConfig(level=options.Options.loglevel) self.logger = logging.getLogger(__name__) self.logger.setLevel(options.Options.loglevel) self.logger.info("Creating Semantic Role " "Labeller with argv: {}".format(argv)) """ Load resources """ self.frameNet = framenet.FrameNet() self.logger.info("Loading FrameNet...") framenet.FrameNetReader( paths.Paths.framenet_path(options.Options.language), self.frameNet) #print("SemanticRoleLabeler framenet frames: {}".format(self.frameNet.frames)) self.logger.info("Loading VerbNet...") self.frames_for_verb, self.verbnet_classes = verbnetreader.init_verbnet( paths.Paths.verbnet_path(options.Options.language)) self.role_matcher = rolematcher.VnFnRoleMatcher( paths.Paths.VNFN_MATCHING, self.frameNet)
def __one_init__(self): self._paths = paths.Paths() self._logger = logger.Logger("Application Config") #TODO: Extend functionality to toggle to remote connect self._use_local_rpc_settings = True self._minMaxModels = { scanning_model.ScanningModel: { "min": dict( time_between_scans=7.0, number_of_scans=1, project_name=None, directory_containing_project=None, project_tag=None, scanner_tag=None, description=None, email=None, pinning_formats=None, fixture=None, scanner=1), "max": dict( time_between_scans=None, number_of_scans=999999, project_name=None, directory_containing_project=None, project_tag=None, scanner_tag=None, description=None, email=None, pinning_formats=None, fixture=None, scanner=1), } } self.reload_settings()
def _create_paths(self): return paths.Paths(self._prefix)