def testInvertValues(files): print('\n--TESTING INVERTING LABEL VALUES') for file in files: print('\n[ FILE: ' + file + ' ]') lg1 = Lg(file) print(lg1) print(lg1.csv()) # Invert values. lg1.invertValues() print(lg1) print(lg1.csv()) # And back to original values. lg1.invertValues() print(lg1) print(lg1.csv())
def testSummingGraphs(mergeFiles): print('\n--TESTS FOR ADDING NODE/EDGE LABEL VALUES') for ( file1, file2 ) in mergeFiles: print('\n[ Merging ' + file1 + ' and ' + file2 + ']') lg1 = Lg(file1) lg2 = Lg(file2) lg1.addWeightedLabelValues(lg2) print(lg1) print(lg1.csv()) print('-- with graph weights 0.25 and 0.75') lg1 = Lg(file1) lg1.gweight = 0.25 lg2 = Lg(file2) lg2.gweight = 0.75 lg1.addWeightedLabelValues(lg2) print(lg1) print(lg1.csv())
def testMaxLabel(mergeFiles): print('\n--TESTS FOR SELECTING MAX. VALUE LABELS') for ( file1, file2 ) in mergeFiles: print('\n[ Selecting max labels from combined ' + file1 + \ ' and ' + file2 + ']') lg1 = Lg(file1) lg2 = Lg(file2) lg1.addWeightedLabelValues(lg2) lg1.selectMaxLabels() print(lg1) print(lg1.csv()) print('-- with graph weights 0.25 and 0.75') lg1 = Lg(file1) lg1.gweight = 0.25 lg2 = Lg(file2) lg2.gweight = 0.75 lg1.addWeightedLabelValues(lg2) lg1.selectMaxLabels() print(lg1) print(lg1.csv())
def loadFiles(testfiles): for nextFile in testfiles: print('[ FILE: ' + nextFile + ' ]') n = Lg(nextFile) print(n) print(n.csv())