def compute(self): self.checkInputPort('csvFile') csv_file = self.getInputFromPort('csvFile') if not LoadAppLogic.IsExistsCSVFile(csv_file.file_entry): raise ModuleError(self, "IsExistsCSVFile failed") self.annotate({'used_files': str([csv_file.file_entry.HeaderPath])}) csv_file.file_entry = \ LoadAppLogic.ReadCSVFileColumnNames(csv_file.file_entry) if not LoadAppLogic.IsMatchCSVFileColumnNames(csv_file.file_entry): raise ModuleError(self, "IsMatchCSVFileColumnNames failed") self.setResult('csvFile', csv_file)
def compute(self): self.check_input('csvFile') csv_file = self.get_input('csvFile') self.annotate({'used_files': str([csv_file.file_entry.HeaderPath])}) res = LoadAppLogic.ReadCSVFileColumnNames(csv_file.file_entry) self.set_output('csvFile', CSVFileEntry(res))
def compute(self): self.check_input('csvFile') self.check_input('dbEntry') csv_file = self.get_input('csvFile') db_entry = self.get_input('dbEntry') self.annotate({'used_tables': str([(db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, csv_file.file_entry.TargetTable)])}) if not LoadAppLogic.UpdateComputedColumns(db_entry.db_entry, csv_file.file_entry): raise ModuleError(self, "UpdateComputedColumns failed") if not LoadAppLogic.IsMatchTableRowCount(db_entry.db_entry, csv_file.file_entry): raise ModuleError(self, "IsMatchTableRowCount failed") if not LoadAppLogic.IsMatchTableColumnRanges(db_entry.db_entry, csv_file.file_entry): raise ModuleError(self, "IsMatchTableColumnRanges failed") self.set_output('dbEntry', db_entry)
def compute(self): self.check_input('csvRootPath') path = self.get_input('csvRootPath') self.annotate({'used_files': str([os.path.join(path, "csv_ready.csv")])}) csv_files = LoadAppLogic.ReadCSVReadyFile(path) # wrapped_res = Collection([CSVFileEntry(e) for e in res], CSVFileEntry) list_of_elts = [CSVFileEntry(f) for f in csv_files] for elt in list_of_elts: elt.upToDate = True self.set_output('csvFiles', list_of_elts)
def compute(self): self.check_input('csvRootPath') path = self.get_input('csvRootPath') if not LoadAppLogic.IsCSVReadyFileExists(path): raise ModuleError(self, "IsCSVReadyFileExists failed") self.annotate({'used_files': str([os.path.join(path, "csv_ready.csv")])}) csv_files = LoadAppLogic.ReadCSVReadyFile(path) if not LoadAppLogic.IsMatchCSVFileTables(csv_files): raise ModuleError(self, "IsMatchCSVFileTables failed") # getter = get_module_registry().get_descriptor_by_name # descriptor = getter('edu.utah.sci.vistrails.basic', # 'List') # list_of_elts = descriptor.module() # list_of_elts.value = [CSVFileEntry(f) for f in csv_files] # self.set_output('csvFiles', list_of_elts) list_of_elts = [CSVFileEntry(f) for f in csv_files] for elt in list_of_elts: elt.upToDate = True print 'list_of_elts:', list_of_elts self.set_output('csvFiles', list_of_elts)
def compute(self): self.check_input('csvFile') self.check_input('dbEntry') csv_file = self.get_input('csvFile') db_entry = self.get_input('dbEntry') self.annotate({'used_tables': str([(db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, csv_file.file_entry.TargetTable)])}) res = LoadAppLogic.IsMatchTableRowCount(db_entry.db_entry, csv_file.file_entry) self.set_output('countsMatch', res)
def compute(self): self.check_input('csvFile') self.check_input('dbEntry') csv_file = self.get_input('csvFile') db_entry = self.get_input('dbEntry') if csv_file.file_entry.TargetTable.upper() == 'P2DETECTION': self.annotate({'used_tables': str([(db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, csv_file.file_entry.TargetTable)])}) res = LoadAppLogic.IsMatchTableColumnRanges(db_entry.db_entry, csv_file.file_entry) self.set_output('rangesMatch', res)
def compute(self): self.check_input('dbEntry') db_entry = self.get_input('dbEntry') high_quality = False if self.has_input('highQuality'): high_quality = self.get_input('highQuality') self.annotate({'used_tables': str([(db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, "P2Detection")])}) histogram = LoadAppLogic.DetectionsHistogram(db_entry.db_entry, high_quality) self.set_output('histogram', histogram)
def compute(self): self.check_input('csvFile') self.check_input('dbEntry') csv_file = self.get_input('csvFile') db_entry = self.get_input('dbEntry') self.annotate({'used_files': str([csv_file.file_entry.FilePath]), 'generated_tables': str([(db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, csv_file.file_entry.TargetTable)])}) res = LoadAppLogic.LoadCSVFileIntoTable(db_entry.db_entry, csv_file.file_entry) self.set_output('success', res)
def compute(self): self.checkInputPort('dbEntry') db_entry = self.getInputFromPort('dbEntry') self.annotate({ 'used_tables': str([(db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, "P2Detection"), (db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, "P2FrameMeta"), (db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, "P2ImageMeta")]) }) LoadAppLogic.CompactDatabase(db_entry.db_entry) self.setResult('dbEntry', db_entry)
def compute(self): self.checkInputPort('csvFile') self.checkInputPort('dbEntry') csv_file = self.getInputFromPort('csvFile') db_entry = self.getInputFromPort('dbEntry') if csv_file.file_entry.TargetTable.upper() == 'P2DETECTION': self.annotate({ 'used_tables': str([ (db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, csv_file.file_entry.TargetTable) ]) }) res = LoadAppLogic.UpdateComputedColumns(db_entry.db_entry, csv_file.file_entry) self.setResult('success', res)
def compute(self): self.check_input('csvFile') self.check_input('dbEntry') csv_file = self.get_input('csvFile') print 'csv_file:', csv_file db_entry = self.get_input('dbEntry') self.annotate({'used_files': str([csv_file.file_entry.FilePath])}) self.annotate({'generated_tables': str([(db_entry.db_entry.ConnectionString, db_entry.db_entry.DBName, csv_file.file_entry.TargetTable)])}) if not LoadAppLogic.LoadCSVFileIntoTable(db_entry.db_entry, csv_file.file_entry): raise ModuleError(self, "LoadCSVFileIntoTable failed") self.set_output('dbEntry', db_entry)
def compute(self): self.check_input('jobID') job_id = self.get_input('jobID') res = LoadAppLogic.CreateEmptyLoadDB(job_id) self.set_output('dbEntry', DatabaseEntry(res))
def compute(self): self.checkInputPort('csvFiles') csv_files = self.getInputFromPort('csvFiles') res = LoadAppLogic.IsMatchCSVFileTables( [f.file_entry for f in csv_files]) self.setResult('tablesMatch', res)
def compute(self): self.checkInputPort('jobID') job_id = self.getInputFromPort('jobID') res = LoadAppLogic.CreateEmptyLoadDB(job_id) self.setResult('dbEntry', DatabaseEntry(res))
def compute(self): self.check_input('csvFiles') csv_files = self.get_input('csvFiles') res = LoadAppLogic.IsMatchCSVFileTables([f.file_entry for f in csv_files]) self.set_output('tablesMatch', res)
def compute(self): self.checkInputPort('csvFile') csv_file = self.getInputFromPort('csvFile') res = LoadAppLogic.IsExistsCSVFile(csv_file.file_entry) self.setResult('fileExists', res)
def __init__(self, db_entry=None): Module.__init__(self) if db_entry is not None: self.db_entry = db_entry else: self.db_entry = LoadAppLogic.DatabaseEntry()
def compute(self): self.check_input('csvFile') csv_file = self.get_input('csvFile') res = LoadAppLogic.IsExistsCSVFile(csv_file.file_entry) self.set_output('fileExists', res)
def compute(self): self.checkInputPort('csvFile') csv_file = self.getInputFromPort('csvFile') res = LoadAppLogic.IsMatchCSVFileColumnNames(csv_file.file_entry) self.setResult('columnsMatch', res)
def __init__(self, file_entry=None): Module.__init__(self) if file_entry is not None: self.file_entry = file_entry else: self.file_entry = LoadAppLogic.CSVFileEntry()
def compute(self): self.check_input('csvFile') csv_file = self.get_input('csvFile') res = LoadAppLogic.IsMatchCSVFileColumnNames(csv_file.file_entry) self.set_output('columnsMatch', res)
def compute(self): self.check_input('csvRootPath') path = self.get_input('csvRootPath') res = LoadAppLogic.IsCSVReadyFileExists(path) self.set_output('fileExists', res)
def compute(self): self.checkInputPort('csvRootPath') path = self.getInputFromPort('csvRootPath') res = LoadAppLogic.IsCSVReadyFileExists(path) self.setResult('fileExists', res)