python_code
stringlengths
0
992k
repo_name
stringlengths
8
46
file_path
stringlengths
5
162
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ writepovfile.py -- write a Part into a POV-Ray file @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. History: Bruce 080917 split this out of graphics/rendering/fileIO.py. For earlier history see that file's reposi...
NanoCAD-master
cad/src/graphics/rendering/povray/writepovfile.py
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details. """ povheader.py @author: Josh @version: $Id$ @copyright: 2004-2007 Nanorex, Inc. See LICENSE file for details. """ #bruce 050413: moved povpoint from 4 other modules (identical copies) into this one. # (I'd leave it in fileIO except that would cause...
NanoCAD-master
cad/src/graphics/rendering/povray/povheader.py
NanoCAD-master
cad/src/graphics/rendering/povray/__init__.py
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details. """ povray.py - routines to support POV-Ray rendering in nE-1. @author: Mark @version: $Id$ @copyright: 2004-2007 Nanorex, Inc. See LICENSE file for details. History: mark 060529 - Created file to support "View > Raytrace Scene". bruce 060711 major...
NanoCAD-master
cad/src/graphics/rendering/povray/povray.py
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details. """ qutemol.py - provides routines to support QuteMolX as a plug-in. @author: Mark @version: $Id$ @copyright: 2004-2007 Nanorex, Inc. See LICENSE file for details. History: mark 2007-06-02 - Created file. Much of the plug-in checking code was copied...
NanoCAD-master
cad/src/graphics/rendering/qutemol/qutemol.py
NanoCAD-master
cad/src/graphics/rendering/qutemol/__init__.py
# Copyright 2006-2009 Nanorex, Inc. See LICENSE file for details. """ displaymodes.py -- support for new modular display modes. @author: Bruce @version: $Id$ @copyright: 2006-2009 Nanorex, Inc. See LICENSE file for details. Initially this only handles ChunkDisplayModes, which draw entire chunks (even if they are hi...
NanoCAD-master
cad/src/graphics/display_styles/displaymodes.py
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. """ CylinderChunks.py -- define a new whole-chunk display mode, which shows a chunk as a single opaque bounding cylinder of the chunk's color. @author: Bruce @version: $Id$ @copyright: 2006-2007 Nanorex, Inc. See LICENSE file for details. This is mai...
NanoCAD-master
cad/src/graphics/display_styles/CylinderChunks.py
NanoCAD-master
cad/src/graphics/display_styles/__init__.py
# Copyright 2008-2009 Nanorex, Inc. See LICENSE file for details. """ ProteinChunks.py -- defines I{Reduced Protein} display modes. @author: Piotr @version: $Id$ @copyright: 2008-2009 Nanorex, Inc. See LICENSE file for details. History: piotr 080623: First preliminary version of the protein display style. piotr 0...
NanoCAD-master
cad/src/graphics/display_styles/ProteinChunks.py
# Copyright 2008-2009 Nanorex, Inc. See LICENSE file for details. """ DnaCylinderChunks.py -- defines I{DNA Cylinder} display mode, which draws axis chunks as a cylinder in the chunk's color. @author: Mark, Piotr @version: $Id$ @copyright: 2008-2009 Nanorex, Inc. See LICENSE file for details. History: Mark 2008-02...
NanoCAD-master
cad/src/graphics/display_styles/DnaCylinderChunks.py
# Copyright 2006-2009 Nanorex, Inc. See LICENSE file for details. """ SurfaceChunks.py -- define a new whole-chunk display mode, which uses Oleksandr's new code to display a chunk as a surface in the chunk's color. @version: $Id$ @copyright: 2006-2009 Nanorex, Inc. See LICENSE file for details. See also CylinderChu...
NanoCAD-master
cad/src/graphics/display_styles/SurfaceChunks.py
# Copyright 2009 Nanorex, Inc. See LICENSE file for details. """ GLPane_drawingset_methods.py -- DrawingSet/CSDL helpers for GLPane_minimal @author: Bruce @version: $Id$ @copyright: 2009 Nanorex, Inc. See LICENSE file for details. History: Bruce 090219 refactored this out of yesterday's additions to Part.after_dra...
NanoCAD-master
cad/src/graphics/widgets/GLPane_drawingset_methods.py
# Copyright 2007-2008 Nanorex, Inc. See LICENSE file for details. """ GLPane_image_methods.py @author: Bruce @version: $Id$ @copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details. History: bruce 070626 wrote some of these in GLPane.py bruce 080919 split this into its own file, added new methods & callin...
NanoCAD-master
cad/src/graphics/widgets/GLPane_image_methods.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ GLPane_mixin_for_DisplayListChunk.py @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. bruce 080910 split this out of class GLPane """ from OpenGL.GL import glGenLists from OpenGL.GL import glNewList from OpenGL.GL...
NanoCAD-master
cad/src/graphics/widgets/GLPane_mixin_for_DisplayListChunk.py
# Copyright 2008 Nanorex, Inc. See LICENSE file for details. """ GLPane_stereo_methods.py @author: Piotr @version: $Id$ @copyright: 2008 Nanorex, Inc. See LICENSE file for details. History: piotr 080515 and 080529 wrote these in GLPane.py bruce 080912 split this into its own file """ import foundation.env as env...
NanoCAD-master
cad/src/graphics/widgets/GLPane_stereo_methods.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ GLPane_lighting_methods.py @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. bruce 080910 split this out of class GLPane """ from graphics.drawing.gl_lighting import glprefs_data_used_by_setup_standard_lights from...
NanoCAD-master
cad/src/graphics/widgets/GLPane_lighting_methods.py
# Copyright 2009 Nanorex, Inc. See LICENSE file for details. """ GLPane_csdl_collector.py -- classes for use as a GLPane's csdl_collector @author: Bruce @version: $Id$ @copyright: 2009 Nanorex, Inc. See LICENSE file for details. History: Bruce 090218 wrote this as part of Part_drawing_frame, then realized it belon...
NanoCAD-master
cad/src/graphics/widgets/GLPane_csdl_collector.py
NanoCAD-master
cad/src/graphics/widgets/__init__.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ GLPane_view_change_methods.py @author: Mark @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. I think Mark wrote most or all of these, in GLPane.py. bruce 080912 split this out of class GLPane """ import time impo...
NanoCAD-master
cad/src/graphics/widgets/GLPane_view_change_methods.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ DynamicTip.py - supports dynamic, informative tooltips of highlighted objects in GLPane History: 060817 Mark created dynamicTip class 060818 Ninad moved DynamicTip class into this file DynamicTip.py and added more @author: Mark, Ninad @version: $I...
NanoCAD-master
cad/src/graphics/widgets/DynamicTip.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ GLPane_minimal.py -- common superclass for GLPane-like widgets. @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. History: bruce 070914 made this to remind us that GLPane and ThumbView need a common superclass (and...
NanoCAD-master
cad/src/graphics/widgets/GLPane_minimal.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ GLPane_text_and_color_methods.py - methods for GLPane related to text rendering or backgroundColor/backgroundGradient (Maybe it should be renamed GLPane_text_and_background_methods?) @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE ...
NanoCAD-master
cad/src/graphics/widgets/GLPane_text_and_color_methods.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ GLPane_event_methods.py @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. bruce 080910 split this out of class GLPane """ import time from PyQt4.Qt import QEvent from PyQt4.Qt import QMouseEvent from PyQt4.Qt impo...
NanoCAD-master
cad/src/graphics/widgets/GLPane_event_methods.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ GLPane.py -- NE1's main model view. A subclass of Qt's OpenGL widget, QGLWidget. @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. NOTE: If you add code to class GLPane, please carefully consider whether it belongs ...
NanoCAD-master
cad/src/graphics/widgets/GLPane.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ ThumbView.py - a simpler OpenGL widget, similar to GLPane (which unfortunately has a lot of duplicated but partly modified code copied from GLPane) @author: Huaicai @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. "...
NanoCAD-master
cad/src/graphics/widgets/ThumbView.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ GLPane_highlighting_methods.py - highlight drawing and hit-detection @author: Bruce @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. bruce 080915 split this out of class GLPane_rendering_methods Russ added some sh...
NanoCAD-master
cad/src/graphics/widgets/GLPane_highlighting_methods.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ GLPane_rendering_methods.py @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. bruce 080913 split this out of class GLPane """ TEST_DRAWING = False # True ## Debug/test switch. Never check in a True value. # A...
NanoCAD-master
cad/src/graphics/widgets/GLPane_rendering_methods.py
# Copyright 2008 Nanorex, Inc. See LICENSE file for details. """ GLPane_frustum_methods.py @author: Piotr @version: $Id$ @copyright: 2008 Nanorex, Inc. See LICENSE file for details. History: piotr circa 080331 wrote these in GLPane.py bruce 080912 split this code into its own file Explanation of code: # The fol...
NanoCAD-master
cad/src/graphics/widgets/GLPane_frustum_methods.py
""" This directory is for startup code. $Id$ Note: new startup functionality should be added to an appropriate file herein, but if possible, not to startup_before_most_imports.py. """
NanoCAD-master
cad/src/ne1_startup/__init__.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ startup_misc.py - miscellaneous application startup functions which are free to do whatever imports they need to. @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. History: bruce 050902 made startup_funcs.py by mov...
NanoCAD-master
cad/src/ne1_startup/startup_misc.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ startup_before_most_imports.py - some application startup functions which need to be run before most imports are done, and which therefore need to be careful about doing imports themselves. @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LI...
NanoCAD-master
cad/src/ne1_startup/startup_before_most_imports.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ main_startup.py -- provides the startup_script function called by main.py @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. History: mostly unrecorded, except in cvs; originally by Josh (under the name atom.py); lo...
NanoCAD-master
cad/src/ne1_startup/main_startup.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ widgets.py - helpers related to widgets, and some simple custom widgets. @author: Mark, Ninad, perhaps others @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. TODO: Probably should be split into a few modules (e.g...
NanoCAD-master
cad/src/widgets/widget_helpers.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ Mixin class to help some of our widgets offer a debug menu. @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. Needs refactoring: [bruce 080104] - to move the global variable (sim_params_set) elsewhere (and maybe a...
NanoCAD-master
cad/src/widgets/DebugMenuMixin.py
# Copyright 2006-2008 Nanorex, Inc. See LICENSE file for details. """ StatusBar.py - status bar widgets, AbortHandler, ProgressReporters @author: Mark, EricM @version: $Id$ @copyright: 2006-2008 Nanorex, Inc. See LICENSE file for details. Module classification: [bruce 071228] It appears to have no requirement of ...
NanoCAD-master
cad/src/widgets/StatusBar.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ menu_helpers.py - helpers for creating or modifying Qt menus @author: Josh, Bruce @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. History: Originally by Josh, as part of GLPane.py. Bruce 050112 moved this code i...
NanoCAD-master
cad/src/widgets/menu_helpers.py
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details. """ simple_dialogs.py - simple dialogs, collected here for convenience. TODO: merge some of them into one function. @author: Bruce, based on code by others @version: $Id$ @copyright: 2004-2009 Nanorex, Inc. See LICENSE file for details. """ from PyQ...
NanoCAD-master
cad/src/widgets/simple_dialogs.py
""" GlobalDisplayStylesComboBox.py - Provides a combo box with all the global display styles. @author: Mark @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE file for details. To do (for Mark): - Add tooltip and What's This text. - Change "Default Display Style" in the preferences dialog (Mode page) to ...
NanoCAD-master
cad/src/widgets/GlobalDisplayStylesComboBox.py
NanoCAD-master
cad/src/widgets/__init__.py
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. """ widget_controllers.py - miscellaneous widget-controller classes @author: bruce @version: $Id$ @copyright: 2006-2007 Nanorex, Inc. See LICENSE file for details. """ # a widget expr controller for a collapsible GroupBox # (different default style ...
NanoCAD-master
cad/src/widgets/widget_controllers.py
# Copyright 2004-2008 Nanorex, Inc. See LICENSE file for details. """ NE1_QToolBar.py - Main NE1 toolbar class, which subclasses Qt's QToolBar class. All NE1 main window toolbars should use this class (except for the Command Toolbar). @author: Mark Sims @version: $Id$ @copyright: 2004-2008 Nanorex, Inc. See LICENSE ...
NanoCAD-master
cad/src/widgets/NE1_QToolBar.py
# Copyright 2005-2008 Nanorex, Inc. See LICENSE file for details. """ prefs_widgets.py -- Utilities related to both user preferences and Qt widgets. Note: also includes some code related to "connect with state" which should be refiled. @author: Bruce @version: $Id$ @copyright: 2005-2008 Nanorex, Inc. See LICENSE fil...
NanoCAD-master
cad/src/widgets/prefs_widgets.py
# Copyright 2007 Nanorex, Inc. See LICENSE file for details. """ NE1ToolBar.py - Variant of QToolBar in which the toolbar border is not rendered @author: Ninad @version: $Id$ @copyright: 2007 Nanorex, Inc. All rights reserved. History: File created on 20070507. There could be more than one NE1Toolbar classes (subc...
NanoCAD-master
cad/src/widgets/NE1ToolBar.py
#!/usr/bin/python # Copyright 2005-2006 Nanorex, Inc. See LICENSE file for details. """runtest.py description.test [--generate] runs the described test and concatenates the results to stdout (after removing lines which vary inconsequentially (e.g. dates) if --generate is given, the results are written to $base.out,...
NanoCAD-master
sim/src/runtest.py
#!/usr/bin/python # Copyright 2006 Nanorex, Inc. See LICENSE file for details. # usage: # # mergemmpxyz.py file.mmp file.xyz > merged.mmp # import sys import re if len(sys.argv) != 3: print >>sys.stderr, "usage: mergemmpxyz.py file.mmp file.xyz > merged.mmp" sys.exit(1) atomLinePattern = re.compile(r"^(ato...
NanoCAD-master
sim/src/mergemmpxyz.py
#!/usr/bin/python # Copyright 2005-2006 Nanorex, Inc. See LICENSE file for details. """run regression tests how to make a regression test: Inside one of the directories listed below, you need to create three files. I'm going to call them test_000X.* here. Just number them sequentially although that doesn't really ...
NanoCAD-master
sim/src/regression.py
#! /usr/bin/python # Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. from string import * import re import os import sys from math import sqrt findBondNamePattern = re.compile(r"^(\S+)\s+(.*)$") bondNamePattern = re.compile(r"(.*)([-=+@#])(.*)$") parameterPattern = re.compile(r"^([^=]+)\s*\=\s*(\S+)\...
NanoCAD-master
sim/src/stretch.py
# Copyright 2004-2006 Nanorex, Inc. See LICENSE file for details. """Vectors, Quaternions, and Trackballs Vectors are a simplified interface to the Numeric arrays. A relatively full implementation of Quaternions. Trackball produces incremental quaternions using a mapping of the screen onto a sphere, tracking the curs...
NanoCAD-master
sim/src/VQT.py
# Copyright 2005-2006 Nanorex, Inc. See LICENSE file for details. ''' setup.py (for sim code) Distutils setup file -- tells distutils how to rebuild our custom extension modules. NOTE: very similar to cad/src/setup.py in the cad cvs module. Some comments and docstrings (more relevant to cad than to sim) appear only ...
NanoCAD-master
sim/src/setup.py
#! /usr/bin/python # Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. from string import * import re import os import sys from math import sqrt findBondNamePattern = re.compile(r"^(\S+)\s+(.*)$") bondNamePattern = re.compile(r"(.*)([-=+@#])(.*)([-=+@#])(.*)$") parameterPattern = re.compile(r"^([^=]+)\...
NanoCAD-master
sim/src/bend.py
#!/usr/bin/env python # Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. """ Users place files into the INPUT directory and run batchsim. After a while, results appear in the OUTPUT directory. Each time batchsim is run, it scans the INPUT directory. Each .mmp file it finds is moved into a consecu...
NanoCAD-master
sim/src/batchsim.py
#!/usr/bin/python # Copyright 2005-2006 Nanorex, Inc. See LICENSE file for details. # usage: # # onetest.py <test_name> [args for tests.py] # # runs a single regression test by name # import sys import tests class Main(tests.Main): def main(self, args): self.theTest = args[0] tests.Main.main(sel...
NanoCAD-master
sim/src/onetest.py
#!/usr/bin/python # Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details. # usage: # # merge.parameters.py existingParameterFile newParameterFiles... # # creates existingParameterFile.new # import sys import re leadingWhitespacePattern = re.compile(r"^\s*") trailingWhitespacePattern = re.compile(r"\s*$") ...
NanoCAD-master
sim/src/merge.parameters.py
#!/usr/bin/python # Copyright 2005-2006 Nanorex, Inc. See LICENSE file for details. """Regression and QA test script for the simulator $Id$ Test cases will generally arrive as MMP files with QM-minimized atom positions (or for QM dynamics simulations, sequences of atom positions). These should be translated into *....
NanoCAD-master
sim/src/tests.py
# Copyright 2006 Nanorex, Inc. See LICENSE file for details. import sys import distutils.sysconfig import distutils.ccompiler class FakeCompiler: def __init__(self): self.compiler_type = distutils.ccompiler.get_default_compiler() def set_executables(self, **kw): for k in kw: setattr(self, k, k...
NanoCAD-master
sim/src/distutils_compile_options.py
# Copyright 2006 Nanorex, Inc. See LICENSE file for details. __author__ = "Will" import sys, os, Pyrex def find_pyrexc(): if sys.platform == 'darwin': # MacOS x = os.path.dirname(Pyrex.__file__).split('/') y = '/'.join(x[:-4] + ['bin', 'pyrexc']) if os.path.exists(y): ...
NanoCAD-master
sim/src/findpyrex.py
# Copyright 2006 Nanorex, Inc. See LICENSE file for details. import sys import time import os.path if sys.platform == "darwin": extra_compile_args = [ "-O" ] else: extra_compile_args = [ ] DISTUTILS_FLAGS = None if sys.platform != "win32": from distutils.core import setup from distutils.extension im...
NanoCAD-master
sim/src/makehelp.py
# Copyright 2005 Nanorex, Inc. See LICENSE file for details. """Physical units for calculations Physical quantities are represented here as dictionaries. One key is 'coefficient', the other keys are metric units like 'm', 'sec', 'kg'. The value for each dimension key is the power to which that unit is raised. For ins...
NanoCAD-master
sim/src/experimental/units.py
#!/usr/bin/python # Copyright 2005 Nanorex, Inc. See LICENSE file for details. # Refer to http://tinyurl.com/8zl86, the 22 Dec discussion about # rotary motors. from math import pi, cos, sin import random import units import sys DEBUG = False DT = 1.e-16 * units.second SPRING_STIFFNESS = 10 * units.newton / units....
NanoCAD-master
sim/src/experimental/rotaryMotor.py
# Copyright 2005 Nanorex, Inc. See LICENSE file for details. """Usage: Type 'python interp.py c' to generate C code. Type 'python interp.py gnuplot' to see graphs of the approximations. Type 'python interp.py quadratic c' to generate C code for a quadratic interpolator. Type 'python interp.py linear c' to generate ...
NanoCAD-master
sim/src/experimental/interp.py
# Copyright 2004-2005 Nanorex, Inc. See LICENSE file for details. """ VQT.py Vectors, Quaternions, and Trackballs Vectors are a simplified interface to the Numeric arrays. A relatively full implementation of Quaternions. Trackball produces incremental quaternions using a mapping of the screen onto a sphere, tracking...
NanoCAD-master
sim/src/experimental/josh_dev/VQT.py
# Copyright 2005 Nanorex, Inc. See LICENSE file for details. from bondage import * e,p,b = readmmp('ethane.mmp') bondsetup(b) dt=1e-16 massacc=array([dt*dt/elmass[x] for x in e]) n=p+massacc*force(p) x= os.times() ## print 'running...', ## for i in xrange(100000): ## o=p ## p=n ## n=2*p-o+massacc*forc...
NanoCAD-master
sim/src/experimental/josh_dev/test.py
# Copyright 2005 Nanorex, Inc. See LICENSE file for details. from Numeric import * from VQT import * from string import * import re keypat = re.compile("(\S+)") molpat = re.compile("mol \(.*\) (\S\S\S)") atompat = re.compile("atom (\d+) \((\d+)\) \((-?\d+), (-?\d+), (-?\d+)\)") def readmmp(fname): pos = [] ...
NanoCAD-master
sim/src/experimental/josh_dev/readmmp.py
#! /usr/bin/python # Copyright 2005 Nanorex, Inc. See LICENSE file for details. from Numeric import * from VQT import * from string import * import re import os import sys keypat = re.compile("(\S+)") molpat = re.compile("mol \(.*\) (\S\S\S)") atompat = re.compile("atom (\d+) \((\d+)\) \((-?\d+), (-?\d+), (-?\d+)\)"...
NanoCAD-master
sim/src/experimental/josh_dev/bondage.py
#!/usr/bin/python import sys import string import Atom class XyzFile: """Python class to contain information from an XYZ file""" def __init__(self): self.atoms = [ ] def clone(self): other = XyzFile() other.atoms = [ ] for a in self.atoms: other.atoms.append(a.c...
NanoCAD-master
sim/src/tests/heteroatom_organics/XyzFile.py
#!/usr/bin/python import os import sys import MmpFile import XyzFile damianFiles = map(lambda x: x.strip(), open("damianFiles").readlines()) for df in damianFiles: prefix = df[:df.index(".")] testPrefix = "test_" + prefix damianMmp = MmpFile.MmpFile() damianMmp.read(df) # Gener...
NanoCAD-master
sim/src/tests/heteroatom_organics/CreateTests.py
#!/usr/bin/python """Grab one of Damian's minimized MMP files, perturb each atom's position by some fraction of an angstrom, write out the result as another MMP file, which becomes an input file for the test. $Id$ """ __author__ = "Will" import re import os import sys import string import Atom class MmpFile: "...
NanoCAD-master
sim/src/tests/heteroatom_organics/MmpFile.py
#!/usr/bin/python """MMP and XYZ files share a common Atom definition. This will make it easy to move information back and forth between the two formats. $Id$ """ __author__ = "Will" import re import os import sys import string import random _PeriodicTable = [ "X", # our singlet has element number zero "H...
NanoCAD-master
sim/src/tests/heteroatom_organics/Atom.py
#!/usr/bin/python import sys import string import Atom class XyzFile: """Python class to contain information from an XYZ file""" def __init__(self): self.atoms = [ ] def clone(self): other = XyzFile() other.atoms = [ ] for a in self.atoms: other.atoms.append(a.c...
NanoCAD-master
sim/src/tests/amino_acids/XyzFile.py
#!/usr/bin/python import os import sys import MmpFile import XyzFile damianFiles = ("ala_l_aminoacid.mmp", "arg_l_aminoacid.mmp", "asn_l_aminoacid.mmp", "asp_l_aminoacid.mmp", "cys_l_aminoacid.mmp", "gln_l_aminoacid.mmp", "glu_l...
NanoCAD-master
sim/src/tests/amino_acids/CreateTests.py
#!/usr/bin/python """Grab one of Damian's minimized MMP files, perturb each atom's position by some fraction of an angstrom, write out the result as another MMP file, which becomes an input file for the test. $Id$ """ __author__ = "Will" import re import os import sys import string import Atom class MmpFile: "...
NanoCAD-master
sim/src/tests/amino_acids/MmpFile.py
#!/usr/bin/python """MMP and XYZ files share a common Atom definition. This will make it easy to move information back and forth between the two formats. $Id$ """ __author__ = "Will" import re import os import sys import string import random _PeriodicTable = [ "X", # our singlet has element number zero "H...
NanoCAD-master
sim/src/tests/amino_acids/Atom.py
#!/usr/bin/python """This script merges an MMP file with an XYZ file, by replacing the MMP file's atom positions with the positions from the XYZ file, producing a new MMP file with the XYZ positions. The merged MMP file is written to standard output. Usage: xyzmerge.py input1.mmp input2.xyz > output.mmp $Id$ """...
NanoCAD-master
sim/src/tests/scripts/xyzmerge.py
#!/usr/bin/python """MMP and XYZ files share a common Atom definition. This will make it easy to move information back and forth between the two formats. $Id$ """ __author__ = "Will" import os import sys import string import Atom class XyzFile: """Python class to contain information from an XYZ file""" def...
NanoCAD-master
sim/src/tests/scripts/XyzFile.py
#!/usr/bin/python """This script examines the structure in an MMP file to enumerate all the bond length terms and bond angle terms for the structure. If an XYZ file is given, use the position information from the XYZ file, otherwise use position information from the MMP file. Bond lengths are in angstroms, bond angles...
NanoCAD-master
sim/src/tests/scripts/findterms.py
#!/usr/bin/python """Grab one of Damian's minimized MMP files, perturb each atom's position by some fraction of an angstrom, write out the result as another MMP file, which becomes an input file for the test. $Id$ """ __author__ = "Will" import re import os import sys import string import Atom class MmpFile: "...
NanoCAD-master
sim/src/tests/scripts/MmpFile.py
#!/usr/bin/python """This script translates an MMP file to an XYZ file. Usage: mmp2xyz.py input.mmp > output.xyz $Id$ """ __author__ = "Will" import sys from MmpFile import MmpFile from XyzFile import XyzFile import Atom try: mmpInputFile = sys.argv[1] xyz = XyzFile() mmp = MmpFile() mmp.read...
NanoCAD-master
sim/src/tests/scripts/mmp2xyz.py
#!/usr/bin/python """A common Atom definition to be shared by the classes for various molecule file formats including MMP and XYZ. This will make it easy to move information back and forth between formats. $Id$ """ __author__ = "Will" import re import os import sys import string import random _PeriodicTable = [ ...
NanoCAD-master
sim/src/tests/scripts/Atom.py
#!/usr/bin/python import sys import string import Atom class XyzFile: """Python class to contain information from an XYZ file""" def __init__(self): self.atoms = [ ] def clone(self): other = XyzFile() other.atoms = [ ] for a in self.atoms: other.atoms.append(a.c...
NanoCAD-master
sim/src/tests/floppy_organics/XyzFile.py
#!/usr/bin/python import os import sys import MmpFile import XyzFile damianFiles = filter(lambda x: x, os.popen("ls C*.mmp").read().split("\n")) for df in damianFiles: prefix = df[:df.index(".")] testPrefix = "test_" + prefix damianMmp = MmpFile.MmpFile() damianMmp.read(df) ...
NanoCAD-master
sim/src/tests/floppy_organics/CreateTests.py
#!/usr/bin/python """Grab one of Damian's minimized MMP files, perturb each atom's position by some fraction of an angstrom, write out the result as another MMP file, which becomes an input file for the test. $Id$ """ __author__ = "Will" import re import os import sys import string import Atom class MmpFile: "...
NanoCAD-master
sim/src/tests/floppy_organics/MmpFile.py
#!/usr/bin/python """MMP and XYZ files share a common Atom definition. This will make it easy to move information back and forth between the two formats. $Id$ """ __author__ = "Will" import re import os import sys import string import random _PeriodicTable = [ "X", # our singlet has element number zero "H...
NanoCAD-master
sim/src/tests/floppy_organics/Atom.py
#!/usr/bin/python import sys import string import Atom class XyzFile: """Python class to contain information from an XYZ file""" def __init__(self): self.atoms = [ ] def clone(self): other = XyzFile() other.atoms = [ ] for a in self.atoms: other.atoms.append(a.c...
NanoCAD-master
sim/src/tests/rigid_organics/XyzFile.py
#!/usr/bin/python import os import sys import MmpFile import XyzFile damianFiles = filter(lambda x: x, os.popen("ls C*.mmp").read().split("\n")) for df in damianFiles: prefix = df[:df.index(".")] testPrefix = "test_" + prefix damianMmp = MmpFile.MmpFile() damianMmp.read(df) ...
NanoCAD-master
sim/src/tests/rigid_organics/CreateTests.py
#!/usr/bin/python """Grab one of Damian's minimized MMP files, perturb each atom's position by some fraction of an angstrom, write out the result as another MMP file, which becomes an input file for the test. $Id$ """ __author__ = "Will" import re import os import sys import string import Atom class MmpFile: "...
NanoCAD-master
sim/src/tests/rigid_organics/MmpFile.py
#!/usr/bin/python """MMP and XYZ files share a common Atom definition. This will make it easy to move information back and forth between the two formats. $Id$ """ __author__ = "Will" import re import os import sys import string import random _PeriodicTable = [ "X", # our singlet has element number zero "H...
NanoCAD-master
sim/src/tests/rigid_organics/Atom.py
#!/usr/bin/python import sys import string import Atom class XyzFile: """Python class to contain information from an XYZ file""" def __init__(self): self.atoms = [ ] def clone(self): other = XyzFile() other.atoms = [ ] for a in self.atoms: other.atoms.append(a.c...
NanoCAD-master
sim/src/tests/singlebond_stretch/XyzFile.py
#!/usr/bin/python import os import sys import MmpFile import XyzFile damianFiles = map(lambda x: x.strip(), open("damianFiles").readlines()) for df in damianFiles: prefix = df[:df.index(".")] testPrefix = "test_" + prefix damianMmp = MmpFile.MmpFile() damianMmp.read(df) # Gener...
NanoCAD-master
sim/src/tests/singlebond_stretch/CreateTests.py
#!/usr/bin/python """Grab one of Damian's minimized MMP files, perturb each atom's position by some fraction of an angstrom, write out the result as another MMP file, which becomes an input file for the test. $Id$ """ __author__ = "Will" import re import os import sys import string import Atom class MmpFile: "...
NanoCAD-master
sim/src/tests/singlebond_stretch/MmpFile.py
#!/usr/bin/python """MMP and XYZ files share a common Atom definition. This will make it easy to move information back and forth between the two formats. $Id$ """ __author__ = "Will" import re import os import sys import string import random _PeriodicTable = [ "X", # our singlet has element number zero "H...
NanoCAD-master
sim/src/tests/singlebond_stretch/Atom.py
#! /usr/bin/python import os import sys import re from Numeric import * from LinearAlgebra import * nampat = re.compile("([A-Z][a-z]?[+=-][A-Z][a-z]?[+=-][A-Z][a-z]?)\.1\.log") thetapat = re.compile(" INPUT CARD\> *theta *= *([\d\.-]+)") engpat = re.compile(" FINAL U-B3LYP ENERGY IS +([\d\.-]+)") hobond = re.compile(...
NanoCAD-master
sim/src/parameters/collang.py
#! /usr/bin/python from Numeric import * from VQT import * from LinearAlgebra import * from string import * import re import os import sys from struct import pack from stat import * datapat = re.compile("\ \$DATA") gradpat = re.compile("\ \$GRAD") hesspat = re.compile(" \$HESS") vecpat = re.compile(" \$VEC") endpat =...
NanoCAD-master
sim/src/parameters/minimize.py
# Copyright (c) 2004 Nanorex, Inc. All rights reserved. """ VQT.py Vectors, Quaternions, and Trackballs Vectors are a simplified interface to the Numeric arrays. A relatively full implementation of Quaternions. Trackball produces incremental quaternions using a mapping of the screen onto a sphere, tracking the curso...
NanoCAD-master
sim/src/parameters/VQT.py
#! /usr/bin/python from string import * import re import os import sys from math import sqrt parmpat = re.compile("([A-Z][a-z]?)([\+=\-@#])([A-Z][a-z]?) +Ks= *([\d\.]+) +R0= *([\d\.]+) +De= *([\d\.]+)") commpat = re.compile("#") elmnts=[("H", 1, 1.6737), ("He", 2, 6.646), ("Li", 3, 11.525),...
NanoCAD-master
sim/src/parameters/parmlist.py
#! /usr/bin/python from Numeric import * import sys import re recpat = re.compile(" *([\d\.E+-]+) +([\d\.E+-]+) +([\d\.E+-]+)") f=open(sys.argv[1]) card = f.readline() m=recpat.match(card) v=array(map(float,(m.group(1),m.group(2), m.group(3)))) while 1: card = f.readline() if len(card)<3: break m=recpat...
NanoCAD-master
sim/src/parameters/dx.py
#! /usr/bin/python from math import * r0=1 De=1 ks=100 beta = sqrt(ks/(2*De)) def morse(r): return De*(1-exp(-sqrt(ks/(2*De))*(r-r0)))**2 def lipp(r): return De*(1-exp(-ks*r0*(r-r0)**2/(2*De*r))) def lippmor(r): if r<r0: return morse(r) - De else: return lipp(r) - De def flp(x): k1 ...
NanoCAD-master
sim/src/parameters/lippmor.py
#! /usr/bin/python from Numeric import * from VQT import * from LinearAlgebra import * from string import * import re import os import sys from struct import pack from stat import * datapat = re.compile("\ \$DATA") gradpat = re.compile("\ \$GRAD") hesspat = re.compile(" \$HESS") vecpat = re.compile(" \$VEC") endpat =...
NanoCAD-master
sim/src/parameters/morgames.py
#! /usr/bin/python import os import sys import re from string import * from math import sqrt leftpat=re.compile('([A-Z][a-z]?)([=+#@-])\.moi$') rightpat=re.compile('([=+#@-])([A-Z][a-z]?)\.moi$') centerpat=re.compile('([=+#@-])([A-Z][a-z]?)([=+#@-])\.moi$') thetapat=re.compile(" *theta *= *([\d\.]+)") parmpat = re....
NanoCAD-master
sim/src/parameters/genang.py
#!/usr/bin/env python3 import argparse import random import os import numpy as np import torch from habitat import logger from habitat_baselines.common.baseline_registry import baseline_registry import habitat_extensions # noqa: F401 import vlnce_baselines # noqa: F401 from vlnce_baselines.config.default import get...
InternVideo-main
Downstream/Visual-Language-Navigation/run.py