Esempio n. 1
0
def diff(S1, S2):
    #if type(S1) != numpy.ndarray:
    #    S1 = S1.lattsite
    #if type(S2) != numpy.ndarray:
    #    S2 = S2.lattsite
    if False:
        diffs = (S1.lattsite != S2.lattsite)
        if not numpy.any(diffs):
            print "no differences"
            return
        diffIndexes = numpy.where(diffs)
        #print diffIndexes[0]
        for i, index in enumerate(diffIndexes[0]):
            #print index, S1[index], S2[index]
            print "(at %4d) %4d -> %4d   "%(index, S1.lattsite[index],
                                                   S2.lattsite[index]),
            if i%3 == 2: print
        print
    # diff by atom numbers
    if True:
        diffs = (S1.atompos != S2.atompos)
        if not numpy.any(diffs):
            print "no differences"
            return
        diffIs = numpy.where(diffs)  # get indexes of moved atoms
        for i, index in enumerate(diffIs[0]):
            print "(#%5d)%5d ->%5d   "%(index, S1.atompos[index],
                                                  S2.atompos[index]),
            if i%3 == 2: print
        print
        
    from rkddp.interact import interact ; interact()
Esempio n. 2
0
def excepthook(t, value, tb):
    # Print the normal traceback.
    sys.__excepthook__(t, value, tb)
    while tb.tb_next is not None:
        tb = tb.tb_next
    #c_d = traceback.extract_tb(tb)
    #from fitz import interactnow
    interact.interact(frame=tb.tb_frame)
Esempio n. 3
0
def run():
    stack = []
    for cmd in sys.argv[1:]:
        cmd = pcd.util.leval(cmd)

        if cmd == 'open_cmty':
            cmtys = pcd.cmty.CommunityFile(stack[-1])
        elif cmd == 'open_graph':
            g = pcd.ioutil.read_any(stack[-1])
        elif cmd == 'interact':
            from fitz import interact
            interact.interact()
        else:
            stack.append(cmd)
Esempio n. 4
0
File: cli.py Progetto: rkdarst/pcd
def run():
    stack = []
    for cmd in sys.argv[1:]:
        cmd = pcd.util.leval(cmd)

        if cmd == "open_cmty":
            cmtys = pcd.cmty.CommunityFile(stack[-1])
        elif cmd == "open_graph":
            g = pcd.ioutil.read_any(stack[-1])
        elif cmd == "interact":
            from fitz import interact

            interact.interact()
        else:
            stack.append(cmd)
Esempio n. 5
0
def callback(SD):
    S = SD.contents.S
    from fitz.interact import interact ; interact()
    return 0
Esempio n. 6
0
def callback(struct_p):
    S = struct_p.contents.S
    from fitz.interact import interact ; interact()
    return 0