rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
self._update()
def select(self): global CHANGE_FROM_TREE if CHANGE_FROM_TREE: #CHANGE_FROM_TREE = False items = self.selectedItems() self.disconnect(self, SIGNAL("selectionChanged()"), self.select)
global CHANGE_FROM_GL if CHANGE_FROM_GL: CHANGE_FROM_GL = False self._update() CHANGE_FROM_GL = True
self._update()
def update(self): """ Build the tree structure of the current model, public interface """ self.disconnect(self, SIGNAL("selectionChanged()"), self.select) global CHANGE_FROM_GL if CHANGE_FROM_GL: CHANGE_FROM_GL = False self._update() CHANGE_FROM_GL = True self.connect(self, SIGNAL("selectionChanged()"), self.select)
self.w.history.message(greenmsg("Select Connected:"))
def selectConnected(self): """Select any atom that can be reached from any currently selected atom through a sequence of bonds. """ ###@@@ should make sure we don't traverse interspace bonds, until all bugs creating them are fixed if not self.selatoms: self.w.history.message(redmsg("Select Connected: No atom(s) selecte...
for a in self.selatoms.values(): self.conncomp(a, 1) def conncomp(self, atom, go=0): if go or not atom.picked:
"select all atoms connected by a sequence of bonds to an already selected one" marked = {} todo = self.selatoms.values() for atom in todo: marked[id(atom)] = atom while todo: newtodo = [] for atom in todo: assert id(atom) in marked for b in atom.bonds: at1, at2 = b.atom1, b.atom2 if id(at1) not in marked: marked[id...
def marksingle(self): for a in self.selatoms.values(): self.conncomp(a, 1)
for a in atom.neighbors(): self.conncomp(a)
return
def conncomp(self, atom, go=0): if go or not atom.picked: atom.pick() for a in atom.neighbors(): self.conncomp(a)
for s in singlet_list[:]: if s is not self.obj_doubleclicked:
for s in singlet_list[:]: if not s.killed():
def transdeposit_from_MMKit(self, singlet_list): '''Trans-deposit the current object in the MMKit on all singlets in <singlet_list>. ''' if not singlet_list: return modkey = self.modkey # save the modkey state if self.modkey is None: self.modkey = 'Shift' # needed for trans-deposit selection consistency when no modifi...
def draw(self, glpane, dispdef, col, level):
def draw(self, glpane, dispdef, col, level, shorten_tubes = False):
def draw(self, glpane, dispdef, col, level): """Draw the bond. Note that for external bonds, this is called twice, once for each bonded molecule (in arbitrary order) (and is never cached in either mol's display list); each of these calls gets dispdef, col, and level from a different mol. [bruce, 041104, thinks that lea...
self.draw(glpane, mol.get_dispdef(glpane), color, mol.assy.drawLevel)
self.draw(glpane, mol.get_dispdef(glpane), color, mol.assy.drawLevel, shorten_tubes = True)
def draw_in_abs_coords(self, glpane, color): #bruce 050609 """Draw this bond in absolute (world) coordinates (even if it's an internal bond), using the specified color (ignoring the color it would naturally be drawn with). """ if self.killed(): #bruce 050702, part of fix 2 of 2 redundant fixes for bug 716 (both fixes a...
elif self.assy: return "<Chunk (%d atoms) at %
try: name = "%r" % self.name except: name = "(exception in self.name repr)" if self.assy: return "<Chunk %s (%d atoms) at %
def __repr__(self): #bruce 041117 # Note: if you extend this, make sure it doesn't recompute anything # (like len(self.singlets) would do) or that will confuse debugging # by making debug-prints trigger recomputes. if self == _nullMol: return "<_nullMol>" elif self.assy: return "<Chunk (%d atoms) at %#x>" % (len(self.a...
return "<Chunk, KILLED (no assy), at %
return "<Chunk %s, KILLED (no assy), at %
def __repr__(self): #bruce 041117 # Note: if you extend this, make sure it doesn't recompute anything # (like len(self.singlets) would do) or that will confuse debugging # by making debug-prints trigger recomputes. if self == _nullMol: return "<_nullMol>" elif self.assy: return "<Chunk (%d atoms) at %#x>" % (len(self.a...
radius == err
radius = err radius *= (1.1/0.77) * 1.0
dispdef = molecule_dispdef(self.basemol, self.o)
self.n_validator = QIntValidator(self) self.n_validator.setRange(3, 1000) self.m_validator = QIntValidator(self) self.m_validator.setRange(0, 1000)
self.m = 5 self.n = 5
def __init__(self, win): nanotube_dialog.__init__(self, win) # win is parent. Fixes bug 1089. Mark 051119. GeneratorBaseClass.__init__(self, win) # Validator for the length linedit widget. self.validator = QDoubleValidator(self) # Range of nanotube length (0-1000, 2 decimal places) # also used to validate bond length...
self.nstr = double_fixup(self.n_validator, str(self.chirality_n_spinbox.value()), self.nstr) n = int(self.nstr)
n_previous = int(self.n) m_previous = int(self.m) n = self.chirality_n_spinbox.value() m = self.chirality_m_spinbox.value() if n < 2: n = 2 if m != self.m: if m > n: n = m elif n != self.n: if m > n: m = n
def length_fixup(self): '''Slot for several validators for different parameters. This gets called each time a user types anything into a widget or changes a spinbox. ''' self.nstr = double_fixup(self.n_validator, str(self.chirality_n_spinbox.value()), self.nstr) n = int(self.nstr) self.chirality_n_spinbox.setValue(n) s...
self.m_validator.setRange(0, n) self.mstr = double_fixup(self.m_validator, str(self.chirality_m_spinbox.value()), self.mstr) self.chirality_m_spinbox.setValue(int(self.mstr))
self.chirality_m_spinbox.setValue(m) self.m, self.n = m, n
def length_fixup(self): '''Slot for several validators for different parameters. This gets called each time a user types anything into a widget or changes a spinbox. ''' self.nstr = double_fixup(self.n_validator, str(self.chirality_n_spinbox.value()), self.nstr) n = int(self.nstr) self.chirality_n_spinbox.setValue(n) s...
"Reverses the last edit or command to the active part. "\ "</p>"
"Reverses the last edit or command which changed structure or selection. "\ "</p>"
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
editRedoText = "<u><b>Redo</b></u> (Ctrl + Y)</b></p><br> "\
import platform if platform.is_macintosh(): redo_accel = "(Ctrl + Shift + Z)" else: redo_accel = "(Ctrl + Y)" editRedoText = "<u><b>Redo</b></u> %s</b></p><br> "\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"Re-applies the actions or commands on which you have used "\ "the Undo command."\ "</p>"
"Restores a change which was undone using the Undo command."\ "</p>" % redo_accel
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.default...
"<b>Edit > Preferences</b> menu and selecting the <b>General</b> tab."\
"<b>Edit > Preferences</b> menu and selecting the <b>Modes</b> tab."\
def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)<br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.defaultFactory(...
if not guess1: print "(debug info: guess1 is false because %r != %r)" % (maindir, ourdir)
if guess1: print "(debug info: guess1 is true because %r != %r)" % (maindir, ourdir)
def before_most_imports( main_globals ): """Do things that should be done before anything that might possibly have side effects. main_globals should be the value of globals() in the __main__ module (our caller, atom.py). """ # user-specific debug code to be run before any other imports [bruce 040903] # gpl_only check...
ang = acos(dot(v1,v2)) * 180/pi
dotprod = dot(v1,v2) if dotprod > 1.0: dotprod = 1.0 elif dotprod < -1.0: dotprod = -1.0 ang = acos(dotprod) * 180/pi
def getinfo(self): # Return information about the selected atom for the msgbar # [mark 2004-10-14] # bruce 041217 revised XYZ format to %.2f, added bad-valence info # (for the same atoms as self.bad(), but in case conditions are added to # that, using independent code). # bruce 050218 changing XYZ format to %.3f (afte...
self.assy.w.history.message(self.getinfo())
if self.assy: self.assy.w.history.message(self.getinfo())
def pick(self): """select the Jig""" self.assy.w.history.message(self.getinfo()) if not self.picked: #bruce 050131 added this condition (maybe good for history.message too?) Node.pick(self) #bruce 050131 for Alpha: using Node.pick self.normcolor = self.color # bug if this is done twice in a row! [bruce 050131 maybe fix...
command += " > " + ntmmp
command += ' > "' + ntmmp + '"' print "System command: [", command, "]"
def debug_hackNanotubes_from_a_dialog( source = "some debug menu??"): title = "debug: SW/MW/HJ nanotubes" label = "put in parameters, e.g. 'SW 20 0 30 1' or\n'HJ 20 10 20 5 0 20 1' or\n'MW 20 5 15 3 5 1'" from qt import QInputDialog # bruce 041216 bugfix text, ok = QInputDialog.getText(title, label) from platform impor...
wd = globalParms['WorkingDirectory'] fn = QFileDialog.getOpenFileName(wd,
if self.assy.filename: odir, fil, ext = fileparse(self.assy.filename) else: odir = globalParms['WorkingDirectory'] fn = QFileDialog.getOpenFileName(odir,
def fileInsert(self): env.history.message(greenmsg("Insert File:")) wd = globalParms['WorkingDirectory'] fn = QFileDialog.getOpenFileName(wd, "Molecular machine parts (*.mmp);;Protein Data Bank (*.pdb);;GAMESS (*.out);;All Files (*.pdb *.mmp *.out)", self, "Insert File dialog", "Select file to insert" ) # This is the...
bonds.bond_atoms(atm, atm2, bonds.V_GRAPHITE)
if not bonds.bonded(atm, atm2): bonds.bond_atoms(atm, atm2, bonds.V_GRAPHITE)
def add(element, x, y, z): atm = Atom(element, chem.V(x, y, z), mol) atm.set_atomtype_but_dont_revise_singlets("sp2") return atm
print "MT.select: item = ",item if item: if item.object.name == self.assy.name: return
def select(self, item):
mmk_geometry = MMKitWin.frameGeometry() mmk_height = mmk_geometry.height()
mmk_height = 470
def _findGoodLocation(self): '''Find ideal location for the MMKit. Should only be called after history, and MMKit has been created.''' global MMKitWin hist_geometry = self.history.widget.frameGeometry() hist_height = hist_geometry.height() mmk_geometry = MMKitWin.frameGeometry() mmk_height = mmk_geometry.height() ##...
y = self.y() + self.geometry().height() - hist_height - mmk_height - toolbar_height
status_bar_height = self.statusBar().frameGeometry().height() y = self.y() + self.geometry().height() - hist_height - mmk_height - toolbar_height - status_bar_height
def _findGoodLocation(self): '''Find ideal location for the MMKit. Should only be called after history, and MMKit has been created.''' global MMKitWin hist_geometry = self.history.widget.frameGeometry() hist_height = hist_geometry.height() mmk_geometry = MMKitWin.frameGeometry() mmk_height = mmk_geometry.height() ##...
MMKitWin.move(pos[0], pos[1]) MMKitWin.show()
if sys.platform == 'linux2': MMKitWin.show() MMKitWin.move(pos[0], pos[1]) else: MMKitWin.move(pos[0], pos[1]) MMKitWin.show()
def modifyMMKit(self): '''Open The Molecular Modeling Kit for Build (DEPOSIT) mode. ''' # This should probably be moved elsewhere global MMKitWin if MMKitWin and MMKitWin.isShown(): return MMKitWin = MMKit(self) MMKitWin.update_dialog(self.Element) pos = self._findGoodLocation() MMKitWin.move(pos[0], pos[1]) MMKitWin....
assert len(ops) == 1
if not ( len(ops) == 1): print_compact_stack("bug: more than one %s op found: " % optype)
def remake_UI_menuitems(self): #e this should also be called again if any undo-related preferences change ###@@@ #e see also: void QPopupMenu::aboutToShow () [signal], for how to know when to run this (when Edit menu is about to show); # to find the menu, no easy way (only way: monitor QAction::addedTo in a custom QAct...
bond.set_v6(new_v6)
def update_bonds_after_each_event( _changed_structure_atoms): ###@@@ so far this is called by update_parts (eg mode chgs), # and near the start of a GLPane repaint event (should be enough), # and only when _changed_structure_atoms is nonempty. #k # It misses hearing about killed atoms or singlets, # but does hear about...
v6 = bond.v6 try: lis = corrected_v6_list[v6] except KeyError: return V_SINGLE atype1 = bond.atom1.atomtype atype2 = bond.atom2.atomtype for v6 in lis: if v6 == V_SINGLE or atype1.permits_v6(v6) and atype2.permits_v6(v6): return v6 assert 0, "no legal replacement for v6 = %r in %r" % (v6,self) return V_SINGLE correc...
def best_corrected_v6(bond): """This bond has an illegal v6 according to its bonded atomtypes (and I guess the atomtypes are what has just changed?? ###k). Say how we want to fix it (or perhaps fix the atomtypes?? #e). """ # Given that the set of permissible bond types (for each atomtype, ignoring S=S prohibition and s...
and do the necessary invalidations.
and do the necessary invalidations (including if the *prior* element type was Singlet).
def mvElement(self, elt): """[Public low-level method:] Change the element type of this atom to element elt (an element object for a real element, not Singlet), and do the necessary invalidations. Note: this does not change any atom or singlet positions, so callers wanting to correct the bond lengths need to do that th...
POSITION_TOLERANCE = 0.5
def addFailure(self, test, err): self.failures.append((test, traceback.format_exception(*err)[-1]))
assert atm1 != atm2
if atm1 == atm2: raise AssertionError("bond from atom to itself?")
def addBondLength(atm1, atm2): assert atm1 != atm2 if atm2 < atm1: atm1, atm2 = atm2, atm1 if bondLengthTerms.has_key(atm1): if atm2 not in bondLengthTerms[atm1]: bondLengthTerms[atm1].append(atm2) else: bondLengthTerms[atm1] = [ atm2 ]
todo("handle multiple-frame xyz files from animations")
def readXyz(self, xyzFilename): # TODO: handle multiple-frame xyz files from animations xyz = XyzFile() xyz.read(xyzFilename) if len(xyz) != self.numAtoms: raise WrongNumberOfAtoms, \ "%d, should be %d" % (len(xyz), self.numAtoms)
def compare(self, xyzFilename1, xyzFilename2): L1, A1 = self.readXyz(xyzFilename1) L2, A2 = self.readXyz(xyzFilename2)
def compare(self, questionableXyzFile, knownGoodXyzFile): todo("handle multiple-frame xyz files from animations") L1, A1 = self.readXyz(questionableXyzFile) L2, A2 = self.readXyz(knownGoodXyzFile)
def compare(self, xyzFilename1, xyzFilename2): # TODO: handle multiple-frame xyz files from animations L1, A1 = self.readXyz(xyzFilename1) L2, A2 = self.readXyz(xyzFilename2) for xyz1, xyz2 in map(None, L1, L2): a1, a2, L = xyz1 a11, a22, LL = xyz2 if a1 != a11 or a2 != a22: raise LengthMismatch("Term (%d, %d) versus (...
raise LengthMismatch("Term (%d, %d) versus (%d, %d)" % (a11, a22, a1, a2))
raise LengthMismatch("Term expected (%d, %d) versus (%d, %d)" % (a1, a2, a11, a22))
def compare(self, xyzFilename1, xyzFilename2): # TODO: handle multiple-frame xyz files from animations L1, A1 = self.readXyz(xyzFilename1) L2, A2 = self.readXyz(xyzFilename2) for xyz1, xyz2 in map(None, L1, L2): a1, a2, L = xyz1 a11, a22, LL = xyz2 if a1 != a11 or a2 != a22: raise LengthMismatch("Term (%d, %d) versus (...
raise LengthMismatch("(%d, %d) -> %f versus %f"
raise LengthMismatch("(%d, %d) expected %f, got %f"
def compare(self, xyzFilename1, xyzFilename2): # TODO: handle multiple-frame xyz files from animations L1, A1 = self.readXyz(xyzFilename1) L2, A2 = self.readXyz(xyzFilename2) for xyz1, xyz2 in map(None, L1, L2): a1, a2, L = xyz1 a11, a22, LL = xyz2 if a1 != a11 or a2 != a22: raise LengthMismatch("Term (%d, %d) versus (...
raise AngleMismatch("Term (%d, %d, %d) versus (%d, %d, %d)" % (a11, a22, a33, a1, a2, a3))
raise AngleMismatch("Term expected (%d, %d, %d) versus (%d, %d, %d)" % (a1, a2, a3, a11, a22, a33))
def compare(self, xyzFilename1, xyzFilename2): # TODO: handle multiple-frame xyz files from animations L1, A1 = self.readXyz(xyzFilename1) L2, A2 = self.readXyz(xyzFilename2) for xyz1, xyz2 in map(None, L1, L2): a1, a2, L = xyz1 a11, a22, LL = xyz2 if a1 != a11 or a2 != a22: raise LengthMismatch("Term (%d, %d) versus (...
raise AngleMismatch("(%d, %d, %d) -> %f versus %f"
raise AngleMismatch("(%d, %d, %d) expected %f, got %f"
def compare(self, xyzFilename1, xyzFilename2): # TODO: handle multiple-frame xyz files from animations L1, A1 = self.readXyz(xyzFilename1) L2, A2 = self.readXyz(xyzFilename2) for xyz1, xyz2 in map(None, L1, L2): a1, a2, L = xyz1 a11, a22, LL = xyz2 if a1 != a11 or a2 != a22: raise LengthMismatch("Term (%d, %d) versus (...
class Unimplemented(AssertionError): pass
def compare(self, xyzFilename1, xyzFilename2): # TODO: handle multiple-frame xyz files from animations L1, A1 = self.readXyz(xyzFilename1) L2, A2 = self.readXyz(xyzFilename2) for xyz1, xyz2 in map(None, L1, L2): a1, a2, L = xyz1 a11, a22, LL = xyz2 if a1 != a11 or a2 != a22: raise LengthMismatch("Term (%d, %d) versus (...
except OSError, e: assert e.args[0] == 2
except OSError, e: pass
def rmtreeSafe(dir): # platform-independent 'rm -rf' try: shutil.rmtree(dir) except OSError, e: assert e.args[0] == 2
DEBUG = 0 PERFORM_MD5_CHECKS = True TESTS_BEYOND_MD5_CHECKS = False GENERATE = False KEEPRESULTS = False
def hex2(ch): return "%02X" % ord(ch)
def __init__(self, simopts=None, inputs=None, outputs=None): self.getBasename()
def __init__(self, dir=None, test=None, simopts=None, inputs=None, outputs=None): self.dirname = dir self.shortname = test self.testname = testname = "test_" + test self.midname = midname = os.sep.join(["tests", dir, testname]) self.basename = os.sep.join([os.getcwd(), midname])
def __init__(self, simopts=None, inputs=None, outputs=None): self.getBasename() if inputs == None: inputs = self.DEFAULT_INPUTS if simopts == None: simopts = self.DEFAULT_SIMOPTS if outputs == None: outputs = self.DEFAULT_OUTPUTS self.inputs = inputs self.outputs = outputs # not using this yet self.runInSandbox(simopt...
self.outputs = outputs self.runInSandbox(simopts) assert self.exitvalue == 0
self.simopts = simopts self.outputs = outputs self.runInSandbox()
def __init__(self, simopts=None, inputs=None, outputs=None): self.getBasename() if inputs == None: inputs = self.DEFAULT_INPUTS if simopts == None: simopts = self.DEFAULT_SIMOPTS if outputs == None: outputs = self.DEFAULT_OUTPUTS self.inputs = inputs self.outputs = outputs # not using this yet self.runInSandbox(simopt...
def runInSandbox(self, opts):
def runInSandbox(self):
def runInSandbox(self, opts): # Run the simulator in sim/src/tmp. here = os.getcwd() tmpdir = "tmp_" + self.dirname + "_" + self.shortname try: rmtreeSafe(tmpdir) os.mkdir(tmpdir) # Copy the input files into the tmp directory. shutil.copy("simulator", tmpdir) # We always have a .mmp file shutil.copy(self.basename + ".m...
cmdline = (("./simulator",) + opts + (self.testname + ".mmp",)) stdout = open("stdout", "w") stderr = open("stderr", "w") if DEBUG > 0: print self.basename print cmdline p = subprocess.Popen(cmdline, stdout=stdout, stderr=stderr) self.exitvalue = p.wait() stdout.close() stderr.close() self.checkOutputFiles()
exitvalue = self.runCommand(self.simopts) if exitvalue != 0: raise AssertionError("simulator exit status was " + repr(exitvalue) + ", expected 0") if GENERATE: self.generateOutputFiles() else: self.checkOutputFiles()
def runInSandbox(self, opts): # Run the simulator in sim/src/tmp. here = os.getcwd() tmpdir = "tmp_" + self.dirname + "_" + self.shortname try: rmtreeSafe(tmpdir) os.mkdir(tmpdir) # Copy the input files into the tmp directory. shutil.copy("simulator", tmpdir) # We always have a .mmp file shutil.copy(self.basename + ".m...
if not KEEPRESULTS: rmtreeSafe(tmpdir) def checkOutputFiles(self):
if not KEEP_RESULTS: rmtreeSafe(tmpdir) def runCommand(self, opts): def substFOO(str): if str.startswith("FOO"): return self.testname + str[3:] return str cmdline = [ "./simulator" ] + map(substFOO, opts)
def runInSandbox(self, opts): # Run the simulator in sim/src/tmp. here = os.getcwd() tmpdir = "tmp_" + self.dirname + "_" + self.shortname try: rmtreeSafe(tmpdir) os.mkdir(tmpdir) # Copy the input files into the tmp directory. shutil.copy("simulator", tmpdir) # We always have a .mmp file shutil.copy(self.basename + ".m...
print os.listdir(".") if DEBUG > 1: print ("******** " + self.basename + " ******** " + repr(self.exitvalue) + " ********") for f in os.listdir("."): if f != "simulator": print "---- " + f + " ----" sys.stdout.write(open(f).read()) if GENERATE: outf = open(self.basename + ".md5sums", "w") stdout = md5sum("stdout") s...
print self.basename print cmdline simProcess = qt.QProcess() stdout = open("stdout", "a") stderr = open("stderr", "a") def blabout(): stdout.write(str(simProcess.readStdout())) def blaberr(): stderr.write(str(simProcess.readStderr())) qt.QObject.connect(simProcess, qt.SIGNAL("readyReadStdout()"), blabout) qt.QObject.co...
def checkOutputFiles(self): if DEBUG > 0: print os.listdir(".") if DEBUG > 1: print ("******** " + self.basename + " ******** " + repr(self.exitvalue) + " ********") for f in os.listdir("."): if f != "simulator": # assume everything else is a text file print "---- " + f + " ----" sys.stdout.write(open(f).read()) if GEN...
return if PERFORM_MD5_CHECKS: inf = open(self.basename + ".md5sums") for line in inf.readlines(): fname, sum = line.split() realsum = md5sum(fname) if realsum != sum: raise self.MD5SumMismatch(self.midname + " " + fname) inf.close() if TESTS_BEYOND_MD5_CHECKS:
def checkOutputFiles(self): if DEBUG > 0: print os.listdir(".") if DEBUG > 1: print ("******** " + self.basename + " ********") for f in os.listdir("."): if f != "simulator": print "---- " + f + " ----" sys.stdout.write(open(f).read()) if MD5_CHECKS: self.checkMd5Sums() if STRUCTURE_COMPARISON_CHECKS:
def checkOutputFiles(self): if DEBUG > 0: print os.listdir(".") if DEBUG > 1: print ("******** " + self.basename + " ******** " + repr(self.exitvalue) + " ********") for f in os.listdir("."): if f != "simulator": # assume everything else is a text file print "---- " + f + " ----" sys.stdout.write(open(f).read()) if GEN...
self.structureComparisonBondlengthsBondangles() def structureComparisonAbsolute(self): xyzcmpname = self.testname + ".xyzcmp" xyzname = self.testname + ".xyz" xyzcmp = open(xyzcmpname) xyz = open(xyzname) natoms = string.atoi(xyzcmp.readline().strip()) natoms2 = string.atoi(xyz.readline().strip()) if natoms != natom...
if C_STRUCT_COMPARE: if self.runCommand(("--base-file", "FOO.xyzcmp", "FOO.xyz")) != 0: raise AssertionError("bad structure match") else: self.structureComparisonBondlengthsBondangles() todo("anything else we should be checking here?") def generateMd5Sums(self): outf = open(self.basename + ".md5sums", "w") outf.writ...
def checkOutputFiles(self): if DEBUG > 0: print os.listdir(".") if DEBUG > 1: print ("******** " + self.basename + " ******** " + repr(self.exitvalue) + " ********") for f in os.listdir("."): if f != "simulator": # assume everything else is a text file print "---- " + f + " ----" sys.stdout.write(open(f).read()) if GEN...
todo("handle multiple-frame xyz files from animations")
def structureComparisonBondlengthsBondangles(self): # TODO: handle multiple-frame xyz files from animations lac = LengthAngleComparison(self.testname + ".mmp") lac.compare(self.testname + ".xyz", self.testname + ".xyzcmp")
pass
DEFAULT_SIMOPTS = None
def structureComparisonBondlengthsBondangles(self): # TODO: handle multiple-frame xyz files from animations lac = LengthAngleComparison(self.testname + ".mmp") lac.compare(self.testname + ".xyz", self.testname + ".xyzcmp")
DEFAULT_SIMOPTS = ("--minimize", "--dump-as-text")
DEFAULT_SIMOPTS = ("--minimize", "--dump-as-text", "FOO.mmp")
def structureComparisonBondlengthsBondangles(self): # TODO: handle multiple-frame xyz files from animations lac = LengthAngleComparison(self.testname + ".mmp") lac.compare(self.testname + ".xyz", self.testname + ".xyzcmp")
DEFAULT_OUTPUTS = ("trc", "xyz") class DynamicsTest(StructureTest):
DEFAULT_SIMOPTS = ("--minimize", "--dump-as-text", "FOO.mmp") DEFAULT_OUTPUTS = ( ) class DynamicsTest(MinimizeTest):
def structureComparisonBondlengthsBondangles(self): # TODO: handle multiple-frame xyz files from animations lac = LengthAngleComparison(self.testname + ".mmp") lac.compare(self.testname + ".xyz", self.testname + ".xyzcmp")
DEFAULT_SIMOPTS = ("--dump-as-text",)
DEFAULT_SIMOPTS = ("--dump-as-text", "FOO.mmp")
def structureComparisonBondlengthsBondangles(self): # TODO: handle multiple-frame xyz files from animations lac = LengthAngleComparison(self.testname + ".mmp") lac.compare(self.testname + ".xyz", self.testname + ".xyzcmp")
StructureTest()
StructureTest(dir="minimize", test="0001")
def test_minimize_0001(self): StructureTest()
PassFailTest(("--num-frames=500", "--minimize", "--dump-as-text"))
PassFailTest(dir="minimize", test="0002", simopts=("--num-frames=500", "--minimize", "--dump-as-text", "FOO.mmp"))
def test_minimize_0002(self): PassFailTest(("--num-frames=500", "--minimize", "--dump-as-text"))
PassFailTest(("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text"))
PassFailTest(dir="minimize", test="0003", simopts=("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text", "FOO.mmp"))
def test_minimize_0003(self): PassFailTest(("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text"))
PassFailTest(("--num-frames=600", "--minimize", "--dump-as-text"))
PassFailTest(dir="minimize", test="0004", simopts=("--num-frames=600", "--minimize", "--dump-as-text", "FOO.mmp"))
def test_minimize_0004(self): PassFailTest(("--num-frames=600", "--minimize", "--dump-as-text"))
StructureTest()
StructureTest(dir="minimize", test="0005")
def test_minimize_0005(self): StructureTest()
PassFailTest(("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text"))
PassFailTest(dir="minimize", test="0006", simopts=("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text", "FOO.mmp"))
def test_minimize_0006(self): PassFailTest(("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text"))
PassFailTest(("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text"))
PassFailTest(dir="minimize", test="0007", simopts=("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text", "FOO.mmp"))
def test_minimize_0007(self): PassFailTest(("--num-frames=300", "--minimize", "--dump-intermediate-text", "--dump-as-text"))
MinimizeTest()
MinimizeTest(dir="minimize", test="0008")
def test_minimize_0008(self): # test ground in minimize MinimizeTest()
StructureTest()
StructureTest(dir="minimize", test="0009")
def test_minimize_0009(self): StructureTest()
MinimizeTest()
MinimizeTest(dir="minimize", test="0010")
def test_minimize_0010(self): MinimizeTest()
MinimizeTest()
MinimizeTest(dir="minimize", test="0011")
def test_minimize_0011(self): MinimizeTest()
MinimizeTest()
MinimizeTest(dir="minimize", test="0012")
def test_minimize_0012(self): MinimizeTest()
StructureTest()
StructureTest(dir="minimize", test="0013")
def test_minimize_0013(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C10H12")
def test_rigid_organics_C10H12(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C10H14")
def test_rigid_organics_C10H14(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C14H20")
def test_rigid_organics_C14H20(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C14H24")
def test_rigid_organics_C14H24(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C2H6")
def test_rigid_organics_C2H6(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C3H6")
def test_rigid_organics_C3H6(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C3H8")
def test_rigid_organics_C3H8(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C4H8")
def test_rigid_organics_C4H8(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C6H10")
def test_rigid_organics_C6H10(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C8H14")
def test_rigid_organics_C8H14(self): StructureTest()
StructureTest()
StructureTest(dir="rigid_organics", test="C8H8")
def test_rigid_organics_C8H8(self): StructureTest()
StructureTest() def test_dynamics_0002(self): DynamicsTest(("--num-frames=100", "--temperature=300", "--iters-per-frame=10", "--dump-as-text"))
StructureTest(dir="rigid_organics", test="CH4") def test_floppy_organics_C2H6(self): StructureTest(dir="floppy_organics", test="C2H6") def test_floppy_organics_C3H8(self): StructureTest(dir="floppy_organics", test="C3H8") def test_floppy_organics_C4H10a(self): StructureTest(dir="floppy_organics", test="C4H10a") def tes...
def test_rigid_organics_CH4(self): StructureTest()
PassFailTest(("--num-frames=30", "--temperature=0", "--iters-per-frame=10000", "--dump-as-text"))
PassFailTest(dir="dynamics", test="0001", simopts=("--num-frames=30", "--temperature=0", "--iters-per-frame=10000", "--dump-as-text", "FOO.mmp"))
def test_dynamics_0001(self): # rotary motor test PassFailTest(("--num-frames=30", "--temperature=0", "--iters-per-frame=10000", "--dump-as-text"))
if "thorough" in sys.argv[1:]: TESTS_BEYOND_MD5_CHECKS = True
if "md5" in sys.argv[1:]: MD5_CHECKS = True if sys.platform != "linux2": raise SystemExit("MD5 checks supported only on Linux") if "lengths-angles" in sys.argv[1:]: STRUCTURE_COMPARISON_CHECKS = True if "structcompare" in sys.argv[1:]: STRUCTURE_COMPARISON_CHECKS = True C_STRUCT_COMPARE = True
def test_dynamics_0001(self): # rotary motor test PassFailTest(("--num-frames=30", "--temperature=0", "--iters-per-frame=10000", "--dump-as-text"))
if "no-md5" in sys.argv[1:]: PERFORM_MD5_CHECKS = False
def test_dynamics_0001(self): # rotary motor test PassFailTest(("--num-frames=30", "--temperature=0", "--iters-per-frame=10000", "--dump-as-text"))
KEEPRESULTS = True
KEEP_RESULTS = True if "todo" in sys.argv[1:]: SHOW_TODO = True MD5_CHECKS = True STRUCTURE_COMPARISON_CHECKS = True if "assertions" in sys.argv[1:]: FULL_ASSERTIONS = True def addFailure(self, test, err): self.failures.append((test, traceback.format_exception(*err)[-1])) if not FULL_ASSERTIONS: unittest.TestResult...
def test_dynamics_0001(self): # rotary motor test PassFailTest(("--num-frames=30", "--temperature=0", "--iters-per-frame=10000", "--dump-as-text"))
QToolTip.add(self.name_linedit,self.__tr("The name of the GAMESS jig.")) QWhatsThis.add(self.name_linedit,self.__tr("The name of the GAMESS jig."))
QToolTip.add(self.name_linedit,self.__tr("Name of the GAMESS jig")) QWhatsThis.add(self.name_linedit,self.__tr("Name of the GAMESS jig."))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.choose_color_btn,self.__tr("Change color"))
QToolTip.add(self.choose_color_btn,self.__tr("Change the GAMESS jig color")) QWhatsThis.add(self.choose_color_btn,self.__tr("Change the GAMESS jig color."))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.rhf_radiobtn,self.__tr("Restricted Hartree-Fock. All electrons are paired and each spatial orbital is doubly occupied. Cannot be used with multiplicities greater than 1."))
QToolTip.add(self.rhf_radiobtn,self.__tr("Restricted Hartree-Fock"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.uhf_radiobtn,self.__tr("Unrestricted Hartree-Fock. All electrons are unpaired and spatial (spin) orbitals are uniquely defined for each electron. More time consuming, but more accurate, than ROHF. "))
QToolTip.add(self.uhf_radiobtn,self.__tr("Unrestricted Hartree-Fock"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.rohf_radiobtn,self.__tr("Restricted Open-shell Hartree-Fock. Spin-paired electrons are assigned to doubly-occupied spatial orbitals, while electrons with unpaired spins are provided unique spatial orbitals."))
QToolTip.add(self.rohf_radiobtn,self.__tr("Restricted Open-shell Hartree-Fock"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.icharg_spinbox,self.__tr("The total charge of the structure to be treated quantum mechanically.")) QWhatsThis.add(self.icharg_spinbox,self.__tr("The total charge of the structure to be treated quantum mechanically."))
QToolTip.add(self.icharg_spinbox,self.__tr("The total charge of the structure (IGHARG)")) QWhatsThis.add(self.icharg_spinbox,self.__tr("The total charge of the structure to be treated quantum mechanically (ICHARG)."))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.multi_combox,self.__tr("N + 1, where N is the number of unpaired electrons.")) QWhatsThis.add(self.multi_combox,self.__tr("N + 1, where N is the number of unpaired electrons."))
QToolTip.add(self.multi_combox,self.__tr("N + 1, where N is the number of unpaired electrons (MULT)")) QWhatsThis.add(self.multi_combox,self.__tr("N + 1, where N is the number of unpaired electrons (MULT)."))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.dirscf_checkbox,self.__tr("Check this box to run the calculation in RAM and avoid hard disk usage for integral storage."))
QToolTip.add(self.dirscf_checkbox,self.__tr("Run the calculation in RAM"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.gbasis_combox,self.__tr("Select from among the standard Gaussian-type basis sets and semi-empirical parameters in GAMESS."))
QToolTip.add(self.gbasis_combox,self.__tr("Gaussian-type basis sets and semi-empirical parameters"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.checkBox10_2_2_2,self.__tr("Only if Hf basis same as CI basis","Only if Hf basis same as CI basis")) QWhatsThis.add(self.checkBox10_2_2_2,self.__tr("Only if Hf basis same as CI basis"))
QToolTip.add(self.checkBox10_2_2_2,self.__tr("Read $VEC group from previous output file","Only if Hf basis same as CI basis")) QWhatsThis.add(self.checkBox10_2_2_2,self.__tr("Reads the $VEC group from the output of a previous GAMESS calculation. Requires that both the molecule and basis set be identical. Useful for r...
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.none_radiobtn,self.__tr("Select this button to neglect electron correlation in the calculation."))
QToolTip.add(self.none_radiobtn,self.__tr("Neglect electron correlation"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.dft_radiobtn,self.__tr("Select this button to perform a density functional theory calculation."))
QToolTip.add(self.dft_radiobtn,self.__tr("Perform a density functional theory calculation"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.mp2_radiobtn,self.__tr("Select this button to perform a Second-Order Moeller Plesset calculation."))
QToolTip.add(self.mp2_radiobtn,self.__tr("Perform a Second-Order Moeller Plesset calculation"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.dfttyp_combox,self.__tr("Select an available density functional in GAMESS."))
QToolTip.add(self.dfttyp_combox,self.__tr("Density functional"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...
QToolTip.add(self.gridsize_combox,self.__tr("Select the grid spacing for the DFT calculation."))
QToolTip.add(self.gridsize_combox,self.__tr("Grid spacing for the DFT calculation"))
def languageChange(self): self.setCaption(self.__tr("GAMESS Properties")) self.psetslbl_2_2.setText(self.__tr("Name :")) self.textLabel1_2_3.setText(self.__tr("Calculate :")) self.textLabel1_3.setText(self.__tr("Description :")) self.textLabel1_3_2.setText(self.__tr("Color :")) self.name_linedit.setText(QString.null) Q...