def test7(): tc.test7() varnames,threshnames,morsedomgraph,morsecells,vertexmap=fp.parseMorseSet() domaingraph=fp.parseDomainGraph() domaincells=fp.parseDomainCells() extendedmorsegraph,extendedmorsecells=pp.makeExtendedMorseSetDomainGraph(vertexmap,morsecells,domaingraph,domaincells) outedges,wallthresh,walldomains,booleanoutedges=pp.makeWallGraphFromDomainGraph(len(vertexmap),extendedmorsegraph, extendedmorsecells) varsaffectedatwall=pp.varsAtWalls(threshnames,walldomains,wallthresh,varnames) print outedges==[(1,),(2,),(3,),(4,),(5,),(0,)] print wallthresh==[1,2,0,1,2,0] print walldomains==[(0.5,1,1.5),(0.5,1.5,1),(1,1.5,0.5),(1.5,1,0.5),(1.5,0.5,1),(1,0.5,1.5)] print varsaffectedatwall==[2,0,1,2,0,1]
def test7(showme=1, findallmatches=1): tc.test7() patterns, originalpatterns, wallinfo = pp.preprocess(cyclic=1) solutions = [None, None, [(1, 2, 3, 4, 5, 0, 1)], [(4, 5, 0, 1, 2, 3, 4)]] patterns = [p for pat in patterns for p in pat] for p, s in zip(patterns, solutions): match = matchPattern(p, wallinfo, cyclic=1, findallmatches=findallmatches) if s: if showme: print match == s else: if showme: print "None" in match and "Pattern" in match
def test7(showme=1, findallmatches=1): tc.test7() patterns, originalpatterns, wallinfo = pp.preprocess(cyclic=1) solutions = [None, None, [(1, 2, 3, 4, 5, 0, 1)], [(4, 5, 0, 1, 2, 3, 4)]] patterns = [p for pat in patterns for p in pat] for p, s in zip(patterns, solutions): match = matchPattern(p, wallinfo, cyclic=1, findallmatches=findallmatches) if s: if showme: print match == s else: if showme: print 'None' in match and 'Pattern' in match
def test7(): tc.test7() varnames, threshnames, morsedomgraph, morsecells, vertexmap = fp.parseMorseSet( ) domaingraph = fp.parseDomainGraph() domaincells = fp.parseDomainCells() extendedmorsegraph, extendedmorsecells = pp.makeExtendedMorseSetDomainGraph( vertexmap, morsecells, domaingraph, domaincells) outedges, wallthresh, walldomains, booleanoutedges = pp.makeWallGraphFromDomainGraph( len(vertexmap), extendedmorsegraph, extendedmorsecells) varsaffectedatwall = pp.varsAtWalls(threshnames, walldomains, wallthresh, varnames) print outedges == [(1, ), (2, ), (3, ), (4, ), (5, ), (0, )] print wallthresh == [1, 2, 0, 1, 2, 0] print walldomains == [(0.5, 1, 1.5), (0.5, 1.5, 1), (1, 1.5, 0.5), (1.5, 1, 0.5), (1.5, 0.5, 1), (1, 0.5, 1.5)] print varsaffectedatwall == [2, 0, 1, 2, 0, 1]