rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
Corkscrew.draw(self) | Corkscrew.draw(self, color = interior_color) | def draw(self, **mods): radius, axis, turn, n, color = self.args color0 = mods.get('color',color)##kluge ##e todo: should be more general; maybe should get "state ref" (to show & edit) as arg, too? if color != color0: if debug_color_override: print "color override in %r from %r to %r" % (self, color, color0) # seems to... |
self.radioButton13.setText(self.__tr("Orthogonal")) | self.radioButton13.setText(self.__tr("Orthographic")) | def languageChange(self): self.setCaption(self.__tr("Preferences")) self.ok_btn.setText(self.__tr("OK")) self.groupBox7_2.setTitle(self.__tr("Compass and Axes")) self.display_compass_checkbox.setText(self.__tr("Display Compass")) self.display_origin_axis_checkbox.setText(self.__tr("Display Origin Axis")) self.display_p... |
if debug_which_renderer: print "using C renderer: VBO %s enabled" % (('is NOT', 'is')[quux.shapeRendererGetInteger(quux.IS_VBO_ENABLED)]) | def finish(): """\ Finish sorting - objects recorded since "start" will be sorted and invoked now. """ if use_c_renderer: quux.shapeRendererInit() # print "VBO %s enabled" % (('is not', 'is')[quux.shapeRendererGetInteger(quux.IS_VBO_ENABLED)]) quux.shapeRendererSetUseDynamicLOD(0) if ColorSorter.sphereLevel != -1: quux... | |
print_compact_stack("exiting right after lval exception, to see if it makes my errors more readable, from here: ") | print_compact_stack("exiting right after lval exception, to see if it makes my errors more readable, from here: ", frame_repr = lambda frame: " %s" % (frame.f_locals.keys(),), linesep = '\n') | def _compute_value(self): """[private] Compute (or recompute) our value, using our compute_method but protecting ourselves from exceptions in it, tracking what it uses, subscribing our inval method to that. NOTE: does not yet handle diffing of prior values of what was used, or the "tracking in order of use" needed for ... |
"ignoring the possibility of errors in any compute method we may have, can our get_value be expected to work right now?" | def can_get_value(self): "ignoring the possibility of errors in any compute method we may have, can our get_value be expected to work right now?" return self.valid or (self._compute_method is not None) | |
if self.assy.selatoms: | if self.disp_not_default_in_selected_atoms(): | def dispResetAtomsDisplay(self): "Resets the display setting for each atom in the selected chunks or atoms to Default display mode" cmd = greenmsg("Reset Atoms Display: ") if self.assy.selmols: self.assy.resetAtomsDisplay() msg = "Display setting for all atoms in selected chunk(s) reset to Default (i.e. their parent ... |
if self.assy.selatoms: | if self.disp_invis_in_selected_atoms(): | def dispShowInvisAtoms(self): "Resets the display setting for each invisible atom in the selected chunks or atoms to Default display mode" cmd = greenmsg("Show Invisible Atoms: ") nia = 0 # nia = Number of Invisible Atoms if self.assy.selmols: nia = self.assy.showInvisibleAtoms() if self.assy.selatoms: for a in self... |
self.o.assy.unpickatoms() modkeys = self.o.modkeys if self.o.modkeys is None: self.o.modkeys = 'Shift' | def transdeposit_from_MMKit(self, singlet): '''Trans-deposit the current object in the MMKit on all singlets reachable through any sequence of bonds to the singlet <singlet>. ''' | |
self.o.modkeys = modkeys | def transdeposit_from_MMKit(self, singlet): '''Trans-deposit the current object in the MMKit on all singlets reachable through any sequence of bonds to the singlet <singlet>. ''' | |
self.o.gl_update() | def deposit_from_Atoms_page(self, atom_or_pos): '''Deposits an atom of the selected atom type from the MMKit Atoms page, or the Clipboard (atom and hybridtype) comboboxes on the dashboard, which are the same atom. If 'atom_or_pos' is a singlet, bond the atom to the singlet. Otherwise, set up the atom at position 'atom_... | |
""" % (HTML_link(url, featurename), HTML_link(wiki_prefix(), "main page")) | """ % (HTML_link(url, featurename), HTML_link(wiki_prefix() + "Main_Page", "main page")) | def open_wiki_help_page( featurename, actually_open = True ): #e actually_open = False is not yet used (and untested) as of 051201 """Open the wiki help page corresponding to the named nE-1 feature, in ways influenced by user preferences. Assume the featurename might contain blanks, but contains no other characters nee... |
print "testing clicked_func, got %r, whose str() is %r" % (url,str(url)) | url = str(url) env.history.message("Wiki help: opening " + url) | def clicked_func(url): #####@@@@@ change this to print a history message print "testing clicked_func, got %r, whose str() is %r" % (url,str(url)) |
if actually_open: env.history.message("Wiki help: opening " + url) try: import webbrowser webbrowser.open( url) except: print_compact_traceback("webbrowser exception: ") env.history.message( redmsg("Problem opening web browser.") + "Suggest opening above URL by hand. "\ "On some platforms, setting BROWSER enviro... | def clicked_func(url): #####@@@@@ change this to print a history message print "testing clicked_func, got %r, whose str() is %r" % (url,str(url)) | |
webbrowser.open(name) self.owner.close() | webbrowser.open(name) if 1: self.owner.deleteLater() | def data(self, name, context=None): # [obs comment:] You'll always get a warning like this: # QTextBrowser: no mimesource for http://.... # This could be avoided with QApplication.qInstallMsgHandler, # but I don't think that's supported until PyQt 3.15. Also this falls # victim to all the problems swarming around webbr... |
expdir = os.path.join(os.curdir, 'experimental') | expdir = os.path.join(os.getcwd(), 'experimental') | def tfm(v, theta=theta+thetaOffset, z1=z+zoffset): # Flip theta, flip z # Cheesy hack: flip theta by reversing the sign of y, # since theta = atan2(y,x) return rotateTranslate(V(v[0], -v[1], -v[2]), theta, z1) |
x = y = 4.0 * self.o.scale | y = self.o.scale x = y * (self.o.width + 0.0) / self.o.height x *= 1.1 y *= 1.1 x += 5 y += 5 | def surface(self): #bruce 050610 revised docstring """Draw the water's surface -- a sketch plane to indicate where the new atoms will sit by default, which also prevents (some kinds of) selection of objects behind it. |
elapmsg = "Elasped Time: " + hhmmss_str(int(win._duration)) | elapmsg = "Elapsed Time: " + hhmmss_str(int(win._duration)) | def show_progressbar_and_stop_button(win, nsteps, filename = '', cmdname = "<unknown command>", show_duration = 0): # misnamed, since specialized for watching a growing file, and since also waits for progress to be done... [bruce 060106 comment] """Display the statusbar's progressbar and stop button, and update it whil... |
f.write("set title \"%s\\n Trace file: %s\\n Created: %s\"\n"%(title, self.traceFile,self.date)) | if sys.platform == 'win32': traceFile = self.traceFile.replace('\\','\\\\') f.write("set title \"%s\\n Trace file: %s\\n Created: %s\"\n"%(title, traceFile, self.date)) | def genPlot(self): """Generates GNUplot plotfile, then calls self.runGNUplot. """ col = self.plot_combox.currentItem() + 2 # Column number to plot # If this plot was the same as the last plot, just run GNUplot on the plotfile. # This allows us to edit the current plotfile in a text editor via "Open GNUplot File" # and... |
f.write('plot "%s" using 1:%d title \"Data Points\" with lines lt 2,\\\n'%(self.traceFile,col)) f.write(' "%s" using 1:%d:(0.5) smooth acsplines title \"Average\" lt 3\n'%(self.traceFile,col)) | f.write('plot "%s" using 1:%d title \"Data Points\" with lines lt 2,\\\n'%(traceFile, col)) f.write(' "%s" using 1:%d:(0.5) smooth acsplines title \"Average\" lt 3\n'%(traceFile, col)) | def genPlot(self): """Generates GNUplot plotfile, then calls self.runGNUplot. """ col = self.plot_combox.currentItem() + 2 # Column number to plot # If this plot was the same as the last plot, just run GNUplot on the plotfile. # This allows us to edit the current plotfile in a text editor via "Open GNUplot File" # and... |
if xy_now == xy_last: | if xy_now == xy_last and self.button == None: | def timerEvent(self, e): # Mark 060806. """When the GLpane's timer expires, a signal is generated calling this slot method. The timer is started in enterEvent() and killed in leaveEvent(), so the timer is only active when the cursor is in the GLpane. This method is part of a hover highlighting optimization and works i... |
return [self.assy.tree, self.assy.shelf] | topnodes = [self.assy.tree, self.assy.shelf] if debug_preftree: try: from Utility import Node import prefsTree as _X reload(_X) from prefsTree import prefsTree self.pt = prefsTree(self.assy) ptnode = self.pt.topnode assert ptnode is not None assert isinstance(ptnode, Node) topnodes.append(ptnode) except: print_compact... | def get_topnodes(self): self.assy = self.win.assy #k need to save it like this? self.assy.tree.name = self.assy.name #k is this still desirable, now that we have PartGroup # so it's no longer needed for safety? kluge_patch_assy_toplevel_groups( self.assy, assert_this_was_not_needed = True) # fixes Group subclasses of a... |
self.tree_item, self.shelf_item = self.topitems | self.tree_item, self.shelf_item = self.topitems[0:2] | def post_update_topitems(self): self.tree_item, self.shelf_item = self.topitems ###k needed?? # the actual items are different each time this is called |
def cm_delete_clipboard(self): | def cm_delete_clipboard(self): "Delete all clipboard items" | def cm_delete_clipboard(self): #bruce 050505 ###e get confirmation from user? for item in self.assy.shelf.members[:]: item.kill() # will this be safe even if one of these is presently displayed? ###k self.mt_update() |
self.permdialog = PermissionDialog(self) | def __init__(self, parent = None, name = None): global windowList undo.just_before_mainwindow_super_init() MainWindow.__init__(self, parent, name, Qt.WDestructiveClose) # fyi: this connects 138 or more signals to our slot methods [bruce 050917 comment] | |
return (self.graphenecntl, self.nanotubecntl, self.dnacntl, self.povrayscenecntl) | return (self.graphenecntl, self.nanotubecntl, self.dnacntl, self.povrayscenecntl, self.minimize_energy) | def sponsoredList(self): return (self.graphenecntl, self.nanotubecntl, self.dnacntl, self.povrayscenecntl) |
if glpane.current_glselect or (0 and 'KLUGE' and hasattr(self, '_saved_stuff')): | saveplace = self.transient_state if glpane.current_glselect or (0 and 'KLUGE' and hasattr(saveplace, '_saved_stuff')): | def draw(self): glMatrixMode(GL_MODELVIEW) # not needed glPushMatrix() glLoadIdentity() try: glpane = self.env.glpane ## aspect = 1.0 ###WRONG but the cases that use it don't work right anyway; BTW does glpane.aspect exist? corner = self.corner delegate = self.delegate want_depth = self.want_depth # note about cov_dept... |
x1, y1, z1 = self._saved_stuff | x1, y1, z1 = saveplace._saved_stuff | def draw(self): glMatrixMode(GL_MODELVIEW) # not needed glPushMatrix() glLoadIdentity() try: glpane = self.env.glpane ## aspect = 1.0 ###WRONG but the cases that use it don't work right anyway; BTW does glpane.aspect exist? corner = self.corner delegate = self.delegate want_depth = self.want_depth # note about cov_dept... |
x1, y1, z1 = self._saved_stuff = gluUnProject(glpane.width, glpane.height, want_depth) | x1, y1, z1 = saveplace._saved_stuff = gluUnProject(glpane.width, glpane.height, want_depth) | def draw(self): glMatrixMode(GL_MODELVIEW) # not needed glPushMatrix() glLoadIdentity() try: glpane = self.env.glpane ## aspect = 1.0 ###WRONG but the cases that use it don't work right anyway; BTW does glpane.aspect exist? corner = self.corner delegate = self.delegate want_depth = self.want_depth # note about cov_dept... |
tmidpoint = csys.xyz((r + 11, midangle, 0)) | tmidpoint = csys.xyz((r + 1, midangle, 0)) | def drawAngleDimension(color, right, up, bpos, p0, p1, p2, text): h = 1.0e-3 z = cross(p0 - p1, p2 - p1) r = max(vlen(p0 - p1), vlen(p2 - p1)) csys = CylindricalCoordinates(p1, z, up, right) if USE_BAUBLES: # Initialize bauble position with br = max(vlen(p0 - p1), vlen(2 - p1)) # Constrain bauble dragging so it lies in... |
return not selobj.killed() | if selobj.killed(): | def selobj_still_ok(self, selobj): #bruce 050702 added this to mode API """Say whether a highlighted mouseover object from a prior draw (in the same mode) is still ok. Default implem says yes unless it's been killed (assuming selobj provides a .killed() method). [overrides anyMode method; subclasses might want to overr... |
self.parameters_grpbox_label_2.setSizePolicy(QSizePolicy(QSizePolicy.Fixed,QSizePolicy.MinimumExpanding,0,0,self.parameters_grpbox_label_2.sizePolicy().hasHeightForWidth())) | self.parameters_grpbox_label_2.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Minimum,0,0,self.parameters_grpbox_label_2.sizePolicy().hasHeightForWidth())) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
"All Files (*.mmp *.pdb);;Molecular machine parts (*.mmp);;Protein Data Bank (*.pdb)", | "Molecular machine parts (*.mmp);;Protein Data Bank (*.pdb);;All Files (*.mmp *.pdb)", | def fileOpen(self): self.history.message(greenmsg("Open File:")) if self.assy.has_changed(): ret = QMessageBox.warning( self, self.name(), "The part contains unsaved changes.\n" "Do you want to save the changes before opening a new part?", "&Save", "&Discard", "Cancel", 0, # Enter == button 0 2 ) # Escape ==... |
self.radioButton11.setText(self.__tr("Mulitple Cylinders")) | self.radioButton11.setText(self.__tr("Multiple Cylinders")) | def languageChange(self): self.setCaption(self.__tr("Preferences")) self.groupBox7_2.setTitle(self.__tr("Compass and Axes")) self.display_compass_checkbox.setText(self.__tr("Display Compass")) self.display_origin_axis_checkbox.setText(self.__tr("Display Origin Axis")) self.display_pov_axis_checkbox.setText(self.__tr("D... |
print_compact_stack() | print_compact_stack("stack when same-atom bond attempted: ") | def bond_atoms(at1,at2): """Make a new bond between atoms at1 and at2 (and add it to their lists of bonds), if they are not already bonded; if they are already bonded do nothing. Return None. (The new bond object, if one is made, can't be found except by scanning the bonds of one of the atoms.) If at1 == at2, this is a... |
if sel.picks_atom(atom): return True return False | if not sel.picks_atom(atom): return False return True | def will_copy_if_selected(self, sel): "[overrides Node method]" # Copy this jig if asked, provided the copy will refer to atoms if necessary. # Whether it's disabled (here and/or in the copy, and why) doesn't matter. if not self.needs_atoms_to_survive(): return True for atom in self.atoms: if sel.picks_atom(atom): retu... |
self.dispCPKAction.setWhatsThis(dispCPKActionText ) | self.dispCPKAction.setWhatsThis(dispCPKActionText ) dispCylinderActionText = "<u><b>Display Cylinder</b></u><br>"\ "<p><img source=\"dispCylinderAction\"><br> "\ "Changes the <i>display setting</i> of selected chunks to "\ "<b>Cylinder</b> mode. Chunks are rendered as cylinders."\ "</p>"\ "<p>If no chunks are selec... | 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(... |
color = tuple(color) + (1.0,) | def draw(self, glpane, offset = V(0,0,0), color = None, info = {}): # this code is copied/modified into a subclass, sorry "draw our spheres (in practice we'll need to extend this for different sets...)" | |
TEST_PYREX_OPENGL = debug_pref("TEST_PYREX_OPENGL", Choice([0,1,2]), non_debug = True) | TEST_PYREX_OPENGL = debug_pref("TEST_PYREX_OPENGL", Choice([0,1,2])) | def Draw(self): if 1: # wware 060124 Embed Pyrex/OpenGL unit tests into the cad code # grantham 060207: # Set to 1 to see a small array of eight spheres. # Set to 2 to see the Large-Bearing model, but this is most effective if # the Large-Bearing has already been loaded normally into rotate mode #bruce 060209 set thi... |
self.EndPick(event, 2) | if env.prefs[selectionBehavior_prefs_key] == A7_SELECTION_BEHAVIOR: self.EndPick(event, 1) else: self.EndPick(event, 2) | def leftUp(self, event): self.EndPick(event, 2) |
if key == Qt.Key_Escape: self.set_selection_filter(0) return | def keyPress(self,key): '''keypress event handler for selectAtomsMode. ''' from MWsemantics import eCCBtab2 basicMode.keyPress(self, key) | |
"All Files (*.*);;"\ | def fileExport(self): # Code copied from fileInsert() slot method. Mark 060731. """Slot method for 'File > Export'. """ if platform.atom_debug: from debug import linenum linenum() print 'start fileExport()' cmd = greenmsg("Export File: ") # This format list generated from the Open Babel wiki page: # http://openbabel.s... | |
from qt import QStringList, QProcess | def fileExport(self): # Code copied from fileInsert() slot method. Mark 060731. """Slot method for 'File > Export'. """ if platform.atom_debug: from debug import linenum linenum() print 'start fileExport()' cmd = greenmsg("Export File: ") # This format list generated from the Open Babel wiki page: # http://openbabel.s... | |
proc.start() | if platform.atom_debug: debugvar = QStringList() debugvar.append('WWARE_DEBUG=1') print 'debugvar', str(debugvar) proc.start(debugvar) else: proc.start() | def runBabel(self, infile, outfile): if platform.atom_debug: print 'start runBabel(%s, %s)' % (repr(infile), repr(outfile)) import time from qt import QStringList, QProcess arguments = QStringList() if sys.platform == 'win32': program = 'babel.exe' else: program = 'babel' i = 0 for arg in [program, infile, outfile]: if... |
stderr = str(proc.readLineStderr()) | stderr = str(proc.readStderr())[:-1] | def runBabel(self, infile, outfile): if platform.atom_debug: print 'start runBabel(%s, %s)' % (repr(infile), repr(outfile)) import time from qt import QStringList, QProcess arguments = QStringList() if sys.platform == 'win32': program = 'babel.exe' else: program = 'babel' i = 0 for arg in [program, infile, outfile]: if... |
print 'stderr says', repr(stderr) | print 'stderr says', stderr | def runBabel(self, infile, outfile): if platform.atom_debug: print 'start runBabel(%s, %s)' % (repr(infile), repr(outfile)) import time from qt import QStringList, QProcess arguments = QStringList() if sys.platform == 'win32': program = 'babel.exe' else: program = 'babel' i = 0 for arg in [program, infile, outfile]: if... |
self.w.glpane.mode.elemSet(value) | self.w.setElement(value) | def setElementInfo(self,value): self.w.glpane.mode.elemSet(value) |
print "set display value",value self.elementNumberLabel.setText(str(value)) self.elementSymbolLabel.setText(elementSymbol[ value ]) self.amuLabel.setText(elementAMU[ value ]) | self.elementNumberLabel.setText(str(value)) self.elementSymbolLabel.setText(elementSymbol[ value ]) self.amuLabel.setText(elementAMU[ value ]) | def setDisplay(self, value): |
self.image0 = QPixmap() self.image0.loadFromData(image0_data,"PNG") | self.image0 = QPixmap(image0_data) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.pushButton51 = QPushButton(self.elementButtonGroup,"pushButton51") self.pushButton51.setEnabled(1) self.pushButton51.setGeometry(QRect(84,279,40,40)) self.pushButton51.setPaletteBackgroundColor(QColor(170,0,255)) pushButton51_font = QFont(self.pushButton51.font()) pushButton51_font.setPointSize(9) pushButton51_fon... | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) | |
self.closePTableButton = QPushButton(self,"closePTableButton") self.closePTableButton.setGeometry(QRect(160,340,100,29)) self.TransmuteButton = QPushButton(self,"TransmuteButton") self.TransmuteButton.setGeometry(QRect(10,340,131,31)) | self.pushButton51 = QPushButton(self.elementButtonGroup,"pushButton51") self.pushButton51.setEnabled(0) self.pushButton51.setGeometry(QRect(84,279,40,40)) self.pushButton51.setPaletteBackgroundColor(QColor(170,0,255)) pushButton51_font = QFont(self.pushButton51.font()) pushButton51_font.setPointSize(9) pushButton51_fon... | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.resize(QSize(266,385).expandedTo(self.minimumSizeHint())) | self.resize(QSize(266,388).expandedTo(self.minimumSizeHint())) | def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl) |
self.pushButton10.setText(self.__tr("10\n" "Ne")) self.closePTableButton.setText(self.__tr("Close")) self.TransmuteButton.setText(self.__tr("Transmute")) | def languageChange(self): self.setCaption(self.__tr("Element Selector")) self.elementButtonGroup.setTitle(QString.null) self.elementNumberLabel.setText(self.__tr("1")) self.amuLabel.setText(self.__tr("1.008")) self.elementSymbolLabel.setText(self.__tr("H")) self.pushButton2.setText(self.__tr("2\n" | |
if sys.platform == 'win32': povray_bin, povray_exe = os.path.split(env.prefs[povray_path_prefs_key]) povray_dir, bin = os.path.split(povray_bin) povray_libpath = os.path.normpath(os.path.join(povray_dir, "include")) else: povray_bin = env.prefs[povray_path_prefs_key].split(os.path.sep) if povray_bin[-2] == 'bin' and po... | try: if sys.platform == 'win32': povray_bin, povray_exe = os.path.split(env.prefs[povray_path_prefs_key]) povray_dir, bin = os.path.split(povray_bin) povray_libpath = os.path.normpath(os.path.join(povray_dir, "include")) elif sys.platform == 'darwin': raise Exception("Povray for the Mac is confusing because it doesn... | def write_povray_ini_file(povray_ini_fname, povrayscene_file, width, height, output_type='png'): '''Write <povray_ini> file. The output image is placed next to the <povrayscene_file> file with the extension based on <output_type>. <width>, <height> are the width and height of the rendered image. (int) <output_type> is ... |
def update_selatom(self, event, singOnly = False, msg_about_click = False, resort_to_prior = True): "keep selatom up-to-date, as atom under mouse; | def update_selatom(self, event, singOnly = False, msg_about_click = False, resort_to_prior = True): '''Keep selatom up-to-date, as atom under mouse based on <event>; When <singOnly> is True, only keep singlets up-to-date. When <msg_about_click> is True, print a message on the statusbar about the LMB press. <resort_to_... | def update_selatom(self, event, singOnly = False, msg_about_click = False, resort_to_prior = True): #bruce 050610 rewrote this "keep selatom up-to-date, as atom under mouse; ###@@@ correctness after rewrite not yet proven, due to delay until paintGL" #& update_selatom() really needs a better docstring. mark 060213. # ... |
if known and selobj is None: selobj = glpane.selatom | def update_selatom(self, event, singOnly = False, msg_about_click = False, resort_to_prior = True): #bruce 050610 rewrote this "keep selatom up-to-date, as atom under mouse; ###@@@ correctness after rewrite not yet proven, due to delay until paintGL" #& update_selatom() really needs a better docstring. mark 060213. # ... | |
if self.mouse_within_stickiness_limit(event): | if self.mouse_within_stickiness_limit(event, DRAG_STICKINESS_LIMIT): | def leftDrag(self, event): '''Drag around <dragatom>, which is either an atom or a singlet. ''' # Do not change the order of the following conditionals unless you know # what you're doing. mark 060208. if self.bond_clicked: # If a LMB+Drag event has happened after selecting a bond in left*Down(), # do a 2D region se... |
if self.selCurve_length/self.o.scale < 0.03: | if self.mouse_within_stickiness_limit(event, DRAG_STICKINESS_LIMIT): | def leftUp(self, event): env.history.flush_saved_transients() # flush any transient message it saved up if self.ignore_next_leftUp_event: # This event is the second leftUp of a double click, so ignore it. self.ignore_next_leftUp_event = False return if self.cursor_over_when_LMB_pressed == 'Empty Space': self.end_sele... |
info = fix_plurals( "%d %s deposited." % (nobjs, object_type) ) | info = fix_plurals( "%d %s deposited." % (nobjs+1, object_type) ) | 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 mouse_within_stickiness_limit(self, event): '''Returns True if the mouse hasn't exceeded the distance determined by the "stickiness limit". Returns False if the mouse has exceeded the limit. | def mouse_within_stickiness_limit(self, event, drag_stickiness_limit): '''Check if mouse has been dragged beyond <drag_stickiness_limit> while holding down the LMB. Returns True if the mouse has not exceeded <drag_stickiness_limit>. Returns False if the mouse has exceeded <drag_stickiness_limit>. <drag_stickiness_limit... | def mouse_within_stickiness_limit(self, event): '''Returns True if the mouse hasn't exceeded the distance determined by the "stickiness limit". Returns False if the mouse has exceeded the limit. ''' if self.drag_stickiness_limit_exceeded: return False LMB_drag_pt, junk = self.o.mousepoints(event, 0.01) self.drag_dista... |
if self.drag_distance/self.o.scale < DRAG_STICKINESS_LIMIT: | if self.drag_distance/self.o.scale < drag_stickiness_limit: | def mouse_within_stickiness_limit(self, event): '''Returns True if the mouse hasn't exceeded the distance determined by the "stickiness limit". Returns False if the mouse has exceeded the limit. ''' if self.drag_stickiness_limit_exceeded: return False LMB_drag_pt, junk = self.o.mousepoints(event, 0.01) self.drag_dista... |
fn = self.get_pvs_filename().replace('.pov', '.png') | fn = '\'' + self.get_pvs_filename().replace('.pov', '.png') + '\'' | def __CM_Display_Image(self): '''Method for "Display Image" context menu. Try to display the image by any means available.''' # What if it's not a PNG? It could be a BMP. fn = self.get_pvs_filename().replace('.pov', '.png') if os.system('display ' + fn) == 0: return if os.system('xv ' + fn) == 0: return env.history.mes... |
from JobManagerDialog import JobManagerDialog | def get_job_manager_job_id_and_dir(): '''Returns a unique Job Id number and JobManager subdirectory for this Job Id. The Job Id is stored in the User Preference db. ''' from preferences import prefs_context prefs = prefs_context() job_id = prefs.get('JobId') if not job_id: job_id = 100 # Start with Job Id 100 ##Tempor... | |
class JobManager(JobManagerDialog): | if 0: class JobManager(JobManagerDialog): | def get_job_manager_job_id_and_dir(): '''Returns a unique Job Id number and JobManager subdirectory for this Job Id. The Job Id is stored in the User Preference db. ''' from preferences import prefs_context prefs = prefs_context() job_id = prefs.get('JobId') if not job_id: job_id = 100 # Start with Job Id 100 ##Tempor... |
def _make_key(self, x, y, z, pack=struct.pack): return pack('lll', x, y, z) def _quantize(self, vec, make_key=self._make_key): | def _quantize(self, vec): | def _make_key(self, x, y, z, pack=struct.pack): return pack('lll', x, y, z) |
return make_key(int(floor(vec[0] / maxradius)), int(floor(vec[1] / maxradius)), int(floor(vec[2] / maxradius))) def add(self, atom, quantize=self._quantize, buckets=self._buckets, oldkeys=self._oldkeys): | return (int(floor(vec[0] / maxradius)), int(floor(vec[1] / maxradius)), int(floor(vec[2] / maxradius))) def add(self, atom): buckets = self._buckets | def _quantize(self, vec, make_key=self._make_key): maxradius = self._maxradius return make_key(int(floor(vec[0] / maxradius)), int(floor(vec[1] / maxradius)), int(floor(vec[2] / maxradius))) |
key = quantize(atom.posn()) if not buckets.has_key(key): buckets[key] = [ ] buckets[key].append(atom) | key = self._quantize(atom.posn()) buckets.setdefault(key, []).append(atom) | def add(self, atom, quantize=self._quantize, buckets=self._buckets, oldkeys=self._oldkeys): if not atom.is_singlet(): key = quantize(atom.posn()) if not buckets.has_key(key): buckets[key] = [ ] buckets[key].append(atom) self._oldkeys[atom.key] = key |
def atom_moved(self, atom, quantize=self._quantize, oldkeys=self._oldkeys, buckets=self._buckets): | def atom_moved(self, atom): | def atom_moved(self, atom, quantize=self._quantize, oldkeys=self._oldkeys, buckets=self._buckets): """If an atom has been added to a neighborhood generator and is later moved, this method must be called to refresh the generator's position information. This only needs to be done during the useful lifecycle of the genera... |
if not oldkeys.has_key(atom.key): raise Exception('this atom is not in this neighborhood generator') oldkey = oldkeys[atom.key] newkey = quantize(atom.posn()) buckets[oldkey].remove(atom) buckets[newkey].append(atom) def region(self, center, quantize=self._quantize, buckets=self._buckets, make_key=self._make_key): | oldkey = self._oldkeys[atom.key] self._buckets[oldkey].remove(atom) self.add(atom) def region(self, center): buckets = self._buckets | def atom_moved(self, atom, quantize=self._quantize, oldkeys=self._oldkeys, buckets=self._buckets): """If an atom has been added to a neighborhood generator and is later moved, this method must be called to refresh the generator's position information. This only needs to be done during the useful lifecycle of the genera... |
x0, y0, z0 = quantize(center) | x0, y0, z0 = self._quantize(center) | def closeEnough(atm, radius=self._maxradius): return vlen(atm.posn() - center) < radius |
key = make_key(x, y, z) | key = (x, y, z) | def closeEnough(atm, radius=self._maxradius): return vlen(atm.posn() - center) < radius |
def remove(self, atom, quantize=self._quantize, buckets=self._buckets): key = quantize(atom.posn()) buckets[key].remove(atom) | def remove(self, atom): key = self._quantize(atom.posn()) self._buckets[key].remove(atom) | def remove(self, atom, quantize=self._quantize, buckets=self._buckets): key = quantize(atom.posn()) buckets[key].remove(atom) |
if evals[ug[0]]/evals[ug[1]] >0.95: axis = evec[ug[2]] else: axis = evec[ug[0]] | try: if evals[ug[0]]/evals[ug[1]] >0.95: axis = evec[ug[2]] else: axis = evec[ug[0]] except ZeroDivisionError: if platform.atom_debug: print_compact_traceback("atom_debug: ignoring ZeroDivisionError: ") axis = evec[ug[0]] | def shakedown_poly_eval_evec_axis(basepos): """Given basepos (an array of atom positions), compute and return (as the elements of a tuple) the bounding polyhedron we should draw around these atoms to designate that their molecule is selected, the eigenvalues and eigenvectors of the inertia tensor (computed as if all at... |
"When selecting this feature, you are placed in "\ "<b>Build Atom</b> mode where you may paste copies "\ "of clipboard objects into the model where ever you click."\ | "<b>Paste</b> places the user in <b>Build</b> mode where copied chunks on "\ "the clipboard can be pasted into the model by double clicking in empty space. "\ "If the current clipboard chunk has a <b><i>hotspot</i></b>, it can be bonded to "\ "another chunk by single clicking on one of the chunk's bondpoints."\ "</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... |
ANGLE_TOLERANCE = 0.5 | ANGLE_TOLERANCE = 5 | def todo(str): if SHOW_TODO: raise Unimplemented(str) |
if MD5_CHECKS: | if TIME_ONLY: startTime, finishTime = self.startTime, time.time() assert finishTime - startTime < 0.5 elif 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": # assume everything else is a text file print "---- " + f + " ----" sys.stdout.write(open(f).read()) if MD5_CHECKS: self.checkMd5Sums() else: if ... |
def test_minimize_0001(self): StructureTest(dir="minimize", test="0001") | def test_minimize_0001(self): StructureTest(dir="minimize", test="0001") | |
def test_minimize_0005(self): StructureTest(dir="minimize", test="0005") | def test_minimize_0005(self): StructureTest(dir="minimize", test="0005") | |
def test_minimize_0008(self): MinimizeTest(dir="minimize", test="0008") | def test_minimize_0008(self): # test ground in minimize MinimizeTest(dir="minimize", test="0008") | |
def test_minimize_0012(self): MinimizeTest(dir="minimize", test="0012") | def test_minimize_0012(self): MinimizeTest(dir="minimize", test="0012") | |
def test_rigid_organics_C14H20(self): StructureTest(dir="rigid_organics", test="C14H20") | def test_rigid_organics_C14H20(self): StructureTest(dir="rigid_organics", test="C14H20") | |
def test_rigid_organics_C2H6(self): StructureTest(dir="rigid_organics", test="C2H6") | def test_rigid_organics_C2H6(self): StructureTest(dir="rigid_organics", test="C2H6") | |
def test_rigid_organics_C6H10(self): StructureTest(dir="rigid_organics", test="C6H10") def test_rigid_organics_C8H14(self): StructureTest(dir="rigid_organics", test="C8H14") | def test_rigid_organics_C6H10(self): StructureTest(dir="rigid_organics", test="C6H10") | |
def test_floppy_organics_C2H6(self): StructureTest(dir="floppy_organics", test="C2H6") | def test_floppy_organics_C2H6(self): StructureTest(dir="floppy_organics", test="C2H6") | |
def test_floppy_organics_C4H10a(self): StructureTest(dir="floppy_organics", test="C4H10a") | def test_floppy_organics_C4H10a(self): StructureTest(dir="floppy_organics", test="C4H10a") | |
def test_floppy_organics_C5H10(self): StructureTest(dir="floppy_organics", test="C5H10") def test_floppy_organics_C5H12a(self): StructureTest(dir="floppy_organics", test="C5H12a") def test_floppy_organics_C5H12b(self): StructureTest(dir="floppy_organics", test="C5H12b") | def test_floppy_organics_C5H10(self): StructureTest(dir="floppy_organics", test="C5H10") | |
def test_floppy_organics_C5H12d(self): StructureTest(dir="floppy_organics", test="C5H12d") def test_floppy_organics_C5H12e(self): StructureTest(dir="floppy_organics", test="C5H12e") def test_floppy_organics_C6H12a(self): StructureTest(dir="floppy_organics", test="C6H12a") | def test_floppy_organics_C5H12d(self): StructureTest(dir="floppy_organics", test="C5H12d") | |
def test_floppy_organics_C6H14a(self): StructureTest(dir="floppy_organics", test="C6H14a") | def test_floppy_organics_C6H14a(self): StructureTest(dir="floppy_organics", test="C6H14a") | |
def test_floppy_organics_C6H14f(self): StructureTest(dir="floppy_organics", test="C6H14f") | def test_floppy_organics_C6H14f(self): StructureTest(dir="floppy_organics", test="C6H14f") | |
def test_amino_acids_ala_l_aminoacid(self): StructureTest(dir="amino_acids", test="ala_l_aminoacid") | def test_amino_acids_ala_l_aminoacid(self): StructureTest(dir="amino_acids", test="ala_l_aminoacid") | |
def test_amino_acids_asn_l_aminoacid(self): StructureTest(dir="amino_acids", test="asn_l_aminoacid") def test_amino_acids_asp_l_aminoacid(self): StructureTest(dir="amino_acids", test="asp_l_aminoacid") def test_amino_acids_cys_l_aminoacid(self): StructureTest(dir="amino_acids", test="cys_l_aminoacid") def test_amino_ac... | def test_amino_acids_asn_l_aminoacid(self): StructureTest(dir="amino_acids", test="asn_l_aminoacid") | |
def test_amino_acids_ile_l_aminoacid(self): StructureTest(dir="amino_acids", test="ile_l_aminoacid") def test_amino_acids_leu_l_aminoacid(self): StructureTest(dir="amino_acids", test="leu_l_aminoacid") def test_amino_acids_lys_l_aminoacid(self): StructureTest(dir="amino_acids", test="lys_l_aminoacid") | def test_amino_acids_ile_l_aminoacid(self): StructureTest(dir="amino_acids", test="ile_l_aminoacid") | |
def test_amino_acids_pro_l_aminoacid(self): StructureTest(dir="amino_acids", test="pro_l_aminoacid") def test_amino_acids_ser_l_aminoacid(self): StructureTest(dir="amino_acids", test="ser_l_aminoacid") def test_amino_acids_thr_l_aminoacid(self): StructureTest(dir="amino_acids", test="thr_l_aminoacid") def test_amino_ac... | def test_amino_acids_pro_l_aminoacid(self): StructureTest(dir="amino_acids", test="pro_l_aminoacid") | |
def tests_heteroatom_organics_ADAMframe_S_Cs(self): StructureTest(dir="heteroatom_organics", test="ADAMframe_S_Cs") | def tests_heteroatom_organics_ADAMframe_S_Cs(self): StructureTest(dir="heteroatom_organics", test="ADAMframe_S_Cs") | |
def tests_heteroatom_organics_ADAM_NH2_Cs(self): StructureTest(dir="heteroatom_organics", test="ADAM_NH2_Cs") def tests_heteroatom_organics_ADAM_OH_Cs(self): StructureTest(dir="heteroatom_organics", test="ADAM_OH_Cs") def tests_heteroatom_organics_ADAM_PH2_Cs(self): StructureTest(dir="heteroatom_organics", test="ADAM_P... | def tests_heteroatom_organics_ADAM_NH2_Cs(self): StructureTest(dir="heteroatom_organics", test="ADAM_NH2_Cs") | |
def tests_heteroatom_organics_B_ADAM_C3v(self): StructureTest(dir="heteroatom_organics", test="B_ADAM_C3v") | def tests_heteroatom_organics_B_ADAM_C3v(self): StructureTest(dir="heteroatom_organics", test="B_ADAM_C3v") | |
def tests_heteroatom_organics_C4H8BH(self): StructureTest(dir="heteroatom_organics", test="C4H8BH") def tests_heteroatom_organics_C4H8NH(self): StructureTest(dir="heteroatom_organics", test="C4H8NH") def tests_heteroatom_organics_C4H8O(self): StructureTest(dir="heteroatom_organics", test="C4H8O") | def tests_heteroatom_organics_C4H8BH(self): StructureTest(dir="heteroatom_organics", test="C4H8BH") | |
def tests_heteroatom_organics_C4H8S(self): StructureTest(dir="heteroatom_organics", test="C4H8S") | def tests_heteroatom_organics_C4H8S(self): StructureTest(dir="heteroatom_organics", test="C4H8S") | |
def tests_heteroatom_organics_C5H10BH(self): StructureTest(dir="heteroatom_organics", test="C5H10BH") | def tests_heteroatom_organics_C5H10BH(self): StructureTest(dir="heteroatom_organics", test="C5H10BH") | |
def tests_heteroatom_organics_C_CH3_3_AlH2(self): StructureTest(dir="heteroatom_organics", test="C_CH3_3_AlH2") def tests_heteroatom_organics_C_CH3_3_BH2(self): StructureTest(dir="heteroatom_organics", test="C_CH3_3_BH2") def tests_heteroatom_organics_C_CH3_3_NH2(self): StructureTest(dir="heteroatom_organics", test="C_... | def tests_heteroatom_organics_C_CH3_3_AlH2(self): StructureTest(dir="heteroatom_organics", test="C_CH3_3_AlH2") | |
def tests_heteroatom_organics_C_CH3_3_SiH3(self): StructureTest(dir="heteroatom_organics", test="C_CH3_3_SiH3") def tests_heteroatom_organics_CH3AlH2(self): StructureTest(dir="heteroatom_organics", test="CH3AlH2") def tests_heteroatom_organics_CH3AlHCH3(self): StructureTest(dir="heteroatom_organics", test="CH3AlHCH3") ... | def tests_heteroatom_organics_C_CH3_3_SiH3(self): StructureTest(dir="heteroatom_organics", test="C_CH3_3_SiH3") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.