analysis = ExplorePara() fail = 0 print 80*'-' print "Testing CalcPara.py" print 80*'-' print "PCS" pcs_in = ['PROTOCOL_NAME', 'pcs', 'STRUCTURES/epsilon.pdb', 'DATASETS/PCS/EPSILON/PCS_epsilon_CNH.npc', '-5.866', '-0.253', '3.113', '39.994', '4.526', '111.122', '105.981', '110.256'] pcs = PCSParser(pcs_in) pcs.doParse() pcs_calcer = CalcPara() pcs_calcer.PCS(pcs, 'ZYZ') analysis.buildNumbatTBL(pcs, 'test_pcs.npc') print "Comparing with known..." exact = open('DATASETS/PCS/EPSILON/EPS_TESTING.npc').readlines() calced = open('test_pcs.npc').readlines() if len(exact) != len(calced): print 'FAILED' fail+=1 for i in range(0, len(exact)): a = exact[i].split() b = calced[i].split() # Tol set to deal with rounding in Numbat if float(a[2]) - float(b[2]) > 0.0011: print 'FAILED' print b[0], float(a[2]) - float(b[2]) fail+=1 print "Number of failures", fail