python_code stringlengths 0 992k | repo_name stringlengths 8 46 | file_path stringlengths 5 162 |
|---|---|---|
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import sys
import string
import unittest
import time
import types
import Numeric
# This is a prototype of the desired API for Pyrex atoms, bonds, and
# atom sets. See "Pyrex atoms and bonds" page on the wiki.
DEBUG = 0
class Failur... | NanoCAD-master | cad/src/experimental/pyrex-atoms-bonds/prototype.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
# $Id$
import string, types, sys, re
from ighelp import *
####################################################
class Program:
def __init__(self):
self.opcodes = [ ]
self.symtab = { }
def run(self):
wh... | NanoCAD-master | cad/src/experimental/pyrex-atoms-bonds/iguana/iguana.py |
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
# $Id$
import iguana
import unittest
baseline_code = """
+!:
<atomic
/* x p */
dup fetch /* x p (*p) */
rot + swap /* (*p)+x p */
store
atomic> exit
foo:
rand exit
bar:
2.718 exit
quux:
ouc... | NanoCAD-master | cad/src/experimental/pyrex-atoms-bonds/iguana/iguanatest.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
# $Id$
import string, os, sys, re
variableName = re.compile("^[_a-zA-Z][_a-zA-Z0-9]*$")
class Op:
def __init__(self, str):
lst = string.split(str, '#')
self.name = string.split(lst.pop(0))
self.cname = ... | NanoCAD-master | cad/src/experimental/pyrex-atoms-bonds/iguana/procops.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
from PyQt4.Qt import *
from PyQt4 import QtCore, QtGui
# Hunt for the icons directory
icons = 'icons'
for i in range(3):
import os
if os.path.exists(icons + '/MainWindowUI_image1.png'):
break
icons = '../' + icons... | NanoCAD-master | cad/src/experimental/basic-qt-app/see-icons.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
from PyQt4.Qt import *
from PyQt4 import QtCore, QtGui
# Hunt for the icons directory
icons = 'icons'
for i in range(3):
import os
if os.path.exists(icons + '/MainWindowUI_image1.png'):
break
icons = '../' + icons... | NanoCAD-master | cad/src/experimental/basic-qt-app/modelTree.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
"""This is a demonstration of some very simple Qt ideas. Qt is so
complicated that you can't just sit down and write a GUI like you
could in Java or Tkinter. You need to start in Qt Designer.
Use designer-qt3 to tweak cruft.ui. Then ... | NanoCAD-master | cad/src/experimental/basic-qt-app/crufty.py |
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import sys
from PyQt4.Qt import *
class Ticker(QObject):
def __init__(self):
QObject.__init__(self)
self.timer = timer = QTimer(self)
#timer.setSingleShot(True)
self.connect(self.timer, SIGNAL("timeout()"), self.hel... | NanoCAD-master | cad/src/experimental/basic-qt-app/ticker.py |
#! /usr/bin/env python
"""
This file, and some of the files in the same directory and/or its subdirs,
are copied and modified from delta_v-r3/run_game.py and/or other programs
by Alex H., author of pyglet. Each such file says so inside it.
"""
import sys
import optparse
import pyglet
from demoapp.ui.DemoAppWindow ... | NanoCAD-master | cad/src/experimental/demoapp_0.1/main.py |
# or maybe store this on the children, as child.size, child.pos, or child.rect, etc?
# since the children sometimes need to know it too (incl when drawing).
def find_child(self, x, y):
for child, (cx,cy,w,h) in self._layout.iteritems(): # maps children -> rects
if (cx <= x < cx + w and
... | NanoCAD-master | cad/src/experimental/demoapp_0.1/outtakes/layout-outtakes.py |
class MouseBehavior_OBS(object): #### REVIEW: might be no longer used, and/or renamed to ToolStateBehavior
# REVIEW: how are MouseBehavior and Tool related in a class hierarchy? guess: Tool's a subclass.
"""
Abstract class for simple mouse behaviors that are temporarily pushed
as handlers onto a pane (b... | NanoCAD-master | cad/src/experimental/demoapp_0.1/outtakes/MouseBehavior-outtakes.py |
class TrivalentGraphDrawingTool_OBS(Tool): # REVIEW: can it turn into HuntForNode with node = None to save coding?
#doc - Active means we know the parent (pane or widget) as self.pane;
# the pane is also what distributes events... it does so through the tool, on its event handler stack
# handlers for when ... | NanoCAD-master | cad/src/experimental/demoapp_0.1/outtakes/TGDT-outtakes.py |
outtakes:
def set_tip(self, tip, obj):
#print "set_tip:", tip, obj # works, except should be a better message when cmd is NOOP, and appearance/location
self.tip.text = tip or ""
self.tip_player = obj
def unset_tip(self):
self.set_tip("", None)
## def on_mouse_motion_FROM_... | NanoCAD-master | cad/src/experimental/demoapp_0.1/outtakes/pane-text-stuff.py |
"""
layout.py - widget layout helpers
$Id$
"""
# semiobs:
# layout alg: leaves send min size up, extra or deficient size allocated down...
# everyone sets their min size, maybe their max size...
# in theory every size-dim has a goodness func which is piecewise linear w/ a few poss slopes...
# so children might pass u... | NanoCAD-master | cad/src/experimental/demoapp_0.1/scratch/layout.py |
# splitter directions
SPLITTER_H = 1 # cares about y coordinate == pos[1]
SPLITTER_V = 0 # cares about x coordinate == pos[0]
class Splitter(PaneWithChildren):
"abstract class for HSplitter and VSplitter"
direction = None # SPLITTER_H or SPLITTER_V in subclasses
def __init__(self, children):
assert... | NanoCAD-master | cad/src/experimental/demoapp_0.1/scratch/Splitter.py |
def rect_contains(rect, pos): #e refile, and use in an if test i have somewhere that inlines it
x, y = pos
x0, y0, w, h = rect
return (x0 <= x < x0 + w and
y0 <= y < y0 + h)
class ChildPane(object):
# for window, use get_size
# but for my own panes, store it...
# and pos
# def... | NanoCAD-master | cad/src/experimental/demoapp_0.1/scratch/Pane.py |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/__init__.py | |
"""
DemoAppWindow.py
$Id$
"""
import pyglet
from pyglet.gl import *
from pyglet import font
from demoapp.tools.TrivalentGraphDrawingTool import TrivalentGraphDrawingTool
from demoapp.tools.DeleteNodeTool import DeleteNodeTool
from demoapp.models.TrivalentGraphModel import TrivalentGraphModel
from demoapp.widget... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/ui/DemoAppWindow.py |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/ui/__init__.py | |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/__init__.py | |
"""
DeleteNodeTool.py - tool for deleting nodes
$Id$
"""
from demoapp.foundation.MouseBehavior import Tool, Transition
from demoapp.tools.HuntForClickAction_ToolStateBehavior import HuntForClickAction_ToolStateBehavior
from demoapp.models.TrivalentGraph_Graphics import TrivalentGraph_HighlightGraphics
# ==
class... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/DeleteNodeTool.py |
"""
ConglomerateDrawingTool.py - shows user good positions for adding new items
(or subassemblies) to "conglomerates" (of objects with lots of attachment and
shape restrictions). Makes it easy to add or move items to nice positions.
$Id$
How it works:
hit test is expanded to cover all nearby objects, and possible mo... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/ConglomerateDrawingTool.py |
tip_text(text, obj or pos)
rubber_edge(thing, thing or pos)
rubber_node(pos)
highlight_refusal(thing)
highlight_connect_to(thing)
highlight_insert_into(edge)
| NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/tool_highlighting.py |
"""
HuntForReleaseAction_ToolStateBehavior.py - help subclasses highlight the same
thing they will do, for releasing the mouse (during a drag) on various objects or spaces
$Id$
"""
# refile into another directory?
from demoapp.foundation.MouseBehavior import parse_command, parse_transition, CMD_RETVAL, ToolStateBehav... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/HuntForReleaseAction_ToolStateBehavior.py |
"""
TrivalentGraphDrawingTool.py - tool for drawing new nodes and edges into a trivalent graph
$Id$
bugs, fri eve 080613:
- sometimes app seemingly can get stuck; not seen recently
- might be fixed:
can't drag an existing node i click in when no edge will be drawn by that click
- not sure i like the lack of drag ... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/TrivalentGraphDrawingTool.py |
"""
GraphSelectionTool.py
$Id$
"""
from demoapp.geometry.vectors import V
from pyglet.event import EVENT_HANDLED
from demoapp.graphics.drawing import drawline2d
from demoapp.foundation.MouseBehavior import Tool, MouseBehavior, parse_command, NOOP
from demoapp.graphics.colors import thin_rubberband_color
# ==
cl... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/GraphSelectionTool.py |
"""
HuntForClickAction_ToolStateBehavior.py - help subclasses highlight the same
thing they will do, for a mouse click or drag on various objects or spaces
$Id$
"""
# refile into another directory?
from demoapp.foundation.MouseBehavior import parse_command, parse_transition, CMD_RETVAL, ToolStateBehavior
class HuntF... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/tools/HuntForClickAction_ToolStateBehavior.py |
from demoapp.graphics.colors import thin_rubberband_color
from demoapp.geometry.vectors import A, get_pos, pos_and_size_from_obj_or_pos
class HighlightGraphics: # maybe rename
"""
Subclasses implement the kinds of tooltip and highlight graphics needed by
specific kinds of tools.
"""
# subclasses c... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/foundation/tool_graphics.py |
"""
Description.py
$Id$
A description is a first-class object whose main purpose is to describe
the structure of another object that could potentially exist or be created.
Specific classes of description can describe specific kinds of objects,
for example, computational processes (or their concrete instantiations),
... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/foundation/Description.py |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/foundation/__init__.py | |
"""
MouseBehavior.py
$Id$
TODO:
split into other files, one for class Tool*,
one for parse_command (rename to avoid confusion w/ user command package?), etc
"""
from pyglet.event import EVENT_HANDLED
from demoapp.foundation.description_utils import description_maker_for_methods_in_class
DEBUG_TRANSITIONS = False
... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/foundation/MouseBehavior.py |
class _fakemethod_class(object):
def __init__(self, name):
self.name = name
def fakemethod(self, *args):
return self.name, args
pass
class Description_Making_Methods(object): #e rename; also let it assertfail if attr not recognized
"#doc"
def __getattr__(self, attr):
if attr... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/foundation/description_utils.py |
"""
TrivalentGraph_Graphics.py
$Id$
"""
from pyglet.gl import *
from demoapp.graphics.colors import red, black, green, yellow
from demoapp.graphics.drawing import drawcircle2d, drawline2d
from demoapp.geometry.vectors import get_pos
from demoapp.foundation.tool_graphics import HighlightGraphics
# ==
NODE_RADIUS... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/models/TrivalentGraph_Graphics.py |
"""
TrivalentGraphModel.py
$Id$
bug: rubber edges stopped working...
"""
from demoapp.geometry.vectors import V, dot, vlen, unitVector, rotate2d_90
import pyglet
from demoapp.graphics.colors import black
from demoapp.graphics.drawing import drawline2d
from demoapp.models.TrivalentGraph_Graphics import NODE_RADIU... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/models/TrivalentGraphModel.py |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/models/__init__.py | |
import array
import math
class A(object):
# not sure if we could successfully subclass array.array;
# at least we'd have to modify __new__ I guess?
def __init__(self, sequence):
self._data = array.array('f', sequence)
return
# these are only needed since we're not subclassing array.arra... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/geometry/vectors.py |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/geometry/__init__.py | |
# drawing primitives (renamed from some taken from soundspace.py); inefficient
from pyglet.gl import *
import math
# ==
def drawdisc2d(r, x, y, slices=20, start=0, end=2*math.pi):
"use after glColor3f; filled"
d = (end - start) / (slices - 1)
s = start
points = [(x, y)] + [(x + r * math.cos(a*d+s), ... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/graphics/drawing.py |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/graphics/__init__.py | |
"""
colors.py
$Id$
"""
black = (0,0,0)
red = (1,0,0)
green = (0,1,0)
blue = (0,0,1)
white = (1,1,1)
thin_rubberband_color = (0.5, 0.5, 0.5)
yellow = (1,1,0)
| NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/graphics/colors.py |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are me... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/widgets/controls.py |
NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/widgets/__init__.py | |
from pyglet.event import EVENT_HANDLED
def _rx(child, x):
if getattr(child, 'relative', False):
### WARNING: not yet true for any class!
### todo: always define it, so no getattr needed;
# or better, make a method on child to transform x or y.
return x - child.x
else:
re... | NanoCAD-master | cad/src/experimental/demoapp_0.1/demoapp/widgets/ChildHolder.py |
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
"""
Generated code that stores a molecular model in Numeric Python arrays
suitable for passing to the quux test renderer
"""
import Numeric
sphereColors = Numeric.array(( Numeric.array((0.840, 0.370, 1.000, 1.000), 'f'), Numeric.array((0.600, 0.200, 0.... | NanoCAD-master | cad/src/experimental/pyrex-opengl/bearing_data.py |
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import sys
from distutils.core import setup
from distutils.extension import Extension
try:
from Pyrex.Distutils import build_ext
except:
print "Problem importing Pyrex"
sys.exit(1)
if sys.platform == "darwin":
extra_compile_args = [ "-... | NanoCAD-master | cad/src/experimental/pyrex-opengl/setup.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import os, sys, string
from math import *
sys.path.append("/home/wware/polosims/cad/src")
from geometry.VQT import A, V, vlen
class AtomType:
def __init__(self, symbol, number, rcovalent):
self.symbol = symbol
s... | NanoCAD-master | cad/src/experimental/zdna-bases/prepare.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import os, sys, threading, time, types, jobqueue
bitrate = 6.0e6
framelimit = None
povray_pretty = True
class Dimensions:
def __init__(self, w, h):
def even(x):
return int(x) & -2
self.width = even(... | NanoCAD-master | cad/src/experimental/animations/animate.py |
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
"""\
jobqueue.py
$Id$
Python code for parallelizing various kinds of jobs on a cluster of
Linux/Unix/Mac machines. Initially being used for raytracing jobs, but
should be useful for other things, perhaps parallel simulations some
day.
"""
import os,... | NanoCAD-master | cad/src/experimental/animations/jobqueue.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import os
# Make up a DVD that tests the borders on a television, to find out
# how big the borders need to be. Start with a black field and a white
# horizontal rectangle, and a text display of the number of border
# pixels as the w... | NanoCAD-master | cad/src/experimental/animations/borders.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import os, sys, animate, string, jobqueue
jobqueue.worker_list = [
('localhost', '/tmp/mpeg'),
('server', '/tmp/mpeg'),
# ('laptop', '/tmp/mpeg'),
# ('mac', '/Users/wware/tmp')
]
rendering = False
# Comment out ... | NanoCAD-master | cad/src/experimental/animations/example.py |
#!/usr/bin/python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
import sys, os
WHERE = '/home/wware/tmp/mpeg'
JUST_CHECK_FOR_INPUTS = False
REALLY = False
def do(cmd):
print cmd
if REALLY: os.system(cmd)
for i in range(1, 9):
outdir = os.path.join(WHERE, "seq%d" % i)
do("rm -rf " + ... | NanoCAD-master | cad/src/experimental/animations/foo.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
from animate import *
from jobqueue import *
preamble = "Presented by"
def drawOneFrame(t, filename):
def move(t, start, finish):
return start + t * (finish - start)
# t varies from 0.0 to 1.0 over the course of the ... | NanoCAD-master | cad/src/experimental/animations/presented_by.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
"""This class should represent an MMP file as an abstract data object.
We can read it in from a conventional *.mmp text file, and if we wish,
write it out in some kind of XML format.
XML has many flaws, but it's got some big benefits... | NanoCAD-master | cad/src/experimental/xml-mmp/MmpFile.py |
# -*- coding: utf_8 -*-
# This file was created using a text editor that displayed unicode
# characters using their native format. The characters in the
# shelfname string below are taking from a Korean newspaper.
# I have no idea what they mean.
shelfname = u"C:\\Documents and Settings\\배드민턴\\Nanorex"
print "ShelfNa... | NanoCAD-master | cad/src/experimental/language_test/language1.py |
#!/usr/bin/env python
# Copyright 2008 Nanorex, Inc. See LICENSE file for details.
"""
Transform coordinates from one basis set to another.
The original purpose of this program is to transform standard DNA
coordinates, such as those used by the 3DNA program, into coefficients
for creating GROMACS virtual sites. It... | NanoCAD-master | cad/src/tools/ChangeOfBasis.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
fixNewlines.py - standardize newlines in each input file, nondestructively
(by producing differently named output files). Also print details of
what kind of newlines were found.
@author: Bruce
@version: $Id$
@copyright: 2007 Nanor... | NanoCAD-master | cad/src/tools/fixNewlines.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
FindPythonGlobals.py
This is a standalone program for static analysis of python source
files. For each file given as an argument, it writes a list of all
of the global symbols defined by the file, each accompanied by the
... | NanoCAD-master | cad/src/tools/FindPythonGlobals.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
UpdateCopyright.py
This is a standalone python script intended to maintain the copyright
notices in all NE1 code. It's intended to be used before each release
in the following way:
First, make sure you have a clean copy of all ... | NanoCAD-master | cad/src/tools/UpdateCopyright.py |
# Copyright 2007-2008 Nanorex, Inc. See LICENSE file for details.
"""
packageData.py -- data about modules and packages, for PackageDependency.py
@author: Eric M, Bruce
@version: $Id$
@copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details.
# NFRs for packageDependency.py: @@@
# unrecognized modules sho... | NanoCAD-master | cad/src/tools/packageData.py |
#!/usr/bin/env python
# Copyright 2007-2008 Nanorex, Inc. See LICENSE file for details.
"""
packageData_checker.py - script for checking and reporting on packageData.py
Note: some of this code might be moved into packageData
if all users of that data should use this code to canonicalize it
before making other use of ... | NanoCAD-master | cad/src/tools/packageData_checker.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
# First argument is file containing output of FindPythonGlobals.py
#
# If second argument is --duplicates, prints a list of duplicate
# globals definitions found in the above file.
#
# If second argument is --check-import, takes a lis... | NanoCAD-master | cad/src/tools/ResolveGlobals.py |
#!/usr/bin/env python
"""
$Id$
parse messages like this
widgets/prefs_widgets.py:472: [W0511] TODO: try to make destroyable_Qt_connection a super of this class
widgets/prefs_widgets.py:39: [C0112, widget_destroyConnectionWithState] Empty docstring
and print them into files based on the W0511 part, named e.g. W0511.t... | NanoCAD-master | cad/src/tools/pylint-sort-msgs.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
PackageDependency.py
$Id$
Takes a list of python files as arguments, writes a list of
packages that each imports on stdout. This information is in a
format suitable for use with the GraphViz package.
To use, ... | NanoCAD-master | cad/src/tools/PackageDependency.py |
#!/usr/bin/env python
# Copyright 2008 Nanorex, Inc. See LICENSE file for details.
"""
Find the length of a vector, given the coordinates of the two ends.
The 2D vectors are offset by a constant Z amount, and one is rotated
by a constant angle.
"""
import sys
import math
dtheta = -36.0 * math.pi / 180.0
s = math... | NanoCAD-master | cad/src/tools/FindLength.py |
#!/usr/bin/env python
# Copyright 2007-2008 Nanorex, Inc. See LICENSE file for details.
"""
@author: Bruce
@version: $Id$
@copyright: 2007-2008 Nanorex, Inc. See LICENSE file for details.
Note: this produces several disconnected graphs in GraphViz
format. I don't know if the entire output
(when it contains more than... | NanoCAD-master | cad/src/tools/splitDependDot.py |
#!/usr/bin/env python
"""
linelen.py - print max line length of each input file, assuming no tabs.
Also print line number of at least one line which is that long.
@author: Bruce
@version: $Id$
@copyright: 2007-2009 Nanorex, Inc. See LICENSE file for details.
"""
import sys, os, time
# bruce 070304, added lineno 090... | NanoCAD-master | cad/src/tools/linelen.py |
#!/usr/bin/env python
# Copyright 2008 Nanorex, Inc. See LICENSE file for details.
"""
Reads a sequence of numbers from stdin, and calculates the mean and
standard deviation.
"""
import sys
from math import sqrt
def main():
numbers = []
line = sys.stdin.readline()
while (line):
numbers.append(fl... | NanoCAD-master | cad/src/tools/MeanStandardDeviation.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
SymbolsInPackage.py
Reads a list of package names from stdin, and writes to stdout a
list of all of the symbols defined in that package in the same
format as FindPythonGlobals.py does.
"""
import sys
if (__name__ ==... | NanoCAD-master | cad/src/tools/SymbolsInPackage.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
FindExternalImports.py
Takes a list of python files as arguments, writes a list of
packages that any of them import outside of the input list.
Suitable for feeding to SymbolsInPackage.py to create an expanded
glob... | NanoCAD-master | cad/src/tools/FindExternalImports.py |
#! /usr/bin/env python
# Released to the public domain, by Tim Peters, 03 October 2000.
"""reindent [-d][-r][-v] [ path ... ]
-d Dry run. Analyze, but don't make any changes to, files.
-r Recurse. Search for all .py files in subdirectories too.
-v Verbose. Print informative msgs; else no output.
Change Python... | NanoCAD-master | cad/src/tools/old/reindent.py |
#! /usr/bin/python
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
"""
checkui.py
$Id$
"""
import sys
from commands import getoutput
import re
from StringIO import StringIO
isdef = re.compile("\s*def (\w*)\(self,?\W*([^)]*)\):")
if __name__ == '__main__':
f = sys.argv[1]
if f[-2:] == 'u... | NanoCAD-master | cad/src/tools/old/checkui.py |
#!/usr/bin/python
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
import re
import os
import xml.dom.minidom
def find_children(node, criterion=None):
kids = [ ]
for e in node.childNodes:
if (criterion is None or criterion(e)):
kids.append(e)
return kids
def first_te... | NanoCAD-master | cad/src/tools/old/generate_connect_statements.py |
#!/usr/bin/env python
# Copyright 2008 Nanorex, Inc. See LICENSE file for details.
"""
SplitDotInFile.py
Splits an AMBER .in file containing residues with internal coordinates
into multiple .in_frag files, one for each residue.
"""
import sys
def parseInFile(fileName):
file = open(fileName)
lines = file.r... | NanoCAD-master | cad/src/tools/AMBER/SplitDotInFile.py |
#!/usr/bin/env python
"""
ParseINI.py
Implements a rudimentary parser for config files used by GROMACS to
define force fields, such as the AMBER force field.
Comments start with ; and can appear anywhere.
These files are designed to be processed through cpp, so they may
include #define statements. For the intended... | NanoCAD-master | cad/src/tools/AMBER/ParseINI.py |
#!/usr/bin/env python
"""
Reads a set of ...nb.itp, ...bon.itp, and .rtp files representing a
GROMACS force field, and the info for translating a .pdb file into a
GROMACS .top file. Where the .rtp file specifies a named set of
torsion parameters, those parameters are checked against the
parameters which would result ... | NanoCAD-master | cad/src/tools/AMBER/CheckForceField.py |
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
This script produces the sponsors.md5 file. It assumes the sponsors.xml file is
in the same directory as it is being run in.
Usage: python generateMD5.py
"""
import md5, base64
m = md5.new()
m.update(open('sponsors.xml').read())
digest = "md5:" + ba... | NanoCAD-master | cad/src/tools/SponsorLogos/generateMD5.py |
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
This script encodes the .png file piped in to text suitable for use in the
sponsors.xml file.
Usage: cat logo.png | python encodeLogo.py > logo.xml
"""
import base64, sys
if (__name__ == '__main__'):
R = base64.encodestring(sys.stdin.read())
... | NanoCAD-master | cad/src/tools/SponsorLogos/encodeLogo.py |
#!/usr/bin/env python
"""
tokenize-python.py -- print tokenization of one or more input .py files
$Id$
History:
bruce 080616 drafted this from an old script I had at home, py-tokenize.py
russ 080617 Added options to format whitespace and to remove certain kinds of
output, to make it more useful for comparing source... | NanoCAD-master | cad/src/tools/Refactoring/tokenize-python.py |
#!/usr/bin/env python
# Copyright 2008 Nanorex, Inc. See LICENSE file for details.
"""
make_gl_imports.py - make import statements for OpenGL identifiers,
which look like:
from OpenGL.GL import GL_MODELVIEW_MATRIX
from OpenGL.GLU import gluUnProject
@author: Bruce
@version: $Id$
@copyright: 2008 Nanorex, Inc. S... | NanoCAD-master | cad/src/tools/Refactoring/make_gl_imports.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
Iterate over all modules in source tree.
Useful as a framework for any portions of a refactoring which need to
be executed for every module. The iterator created by
ModuleIterator() produces (fileName, moduleName) pairs for each... | NanoCAD-master | cad/src/tools/Refactoring/ModuleIterator.py |
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
Update imports to reflect the renaming of a module.
Usage::
tools/Refactoring/RenameModule.py [options] old/path.py new/pathname.py
or
tools/Refactoring/RenameModule.py old/path.py new/
Finds all instances where a modul... | NanoCAD-master | cad/src/tools/Refactoring/RenameModule.py |
NanoCAD-master | cad/src/analysis/__init__.py | |
# -*- coding: utf-8 -*-
# Copyright 2006-2007 Nanorex, Inc. See LICENSE file for details.
# Form implementation generated from reading ui file 'ESPImagePropDialog.ui'
#
# Created: Wed Sep 27 14:24:14 2006
# by: PyQt4 UI code generator 4.0.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 imp... | NanoCAD-master | cad/src/analysis/ESP/ESPImagePropDialog.py |
# Copyright 2004-2009 Nanorex, Inc. See LICENSE file for details.
"""
ESPImage.py - display an Electrostatic Potential Image (or any OpenGL texture)
Note: keep this around, even if ESPImage per se becomes obsolete,
since it's also our only working Node for directly displaying an image in
the 3d model space.
@author:... | NanoCAD-master | cad/src/analysis/ESP/ESPImage.py |
# Copyright 2005-2007 Nanorex, Inc. See LICENSE file for details.
"""
NanoHive_SimParameters.py - provide class NanoHive_SimParameters
@author: Mark
@version: $Id$
@copyright: 2005-2007 Nanorex, Inc. See LICENSE file for details.
History:
Bruce 071215 split this out of NanoHive.py to remove
an import cycle, and re... | NanoCAD-master | cad/src/analysis/ESP/NanoHive_SimParameters.py |
NanoCAD-master | cad/src/analysis/ESP/__init__.py | |
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
"""
ESPImageProp.py
$Id$
"""
from PyQt4.Qt import QWidget
from PyQt4.Qt import SIGNAL
from PyQt4.Qt import QColorDialog
from PyQt4.Qt import QDialog
from analysis.ESP.ESPImagePropDialog import Ui_ESPImagePropDialog
from widgets.widget_helpers import... | NanoCAD-master | cad/src/analysis/ESP/ESPImageProp.py |
# Copyright 2005-2008 Nanorex, Inc. See LICENSE file for details.
"""
NanoHiveUtils.py
@author: Brian, Mark
@version: $Id$
@copyright: 2005-2008 Nanorex, Inc. See LICENSE file for details.
History:
Brian wrote the NH_Connection class.
Mark wrote everything else.
Module classification:
Mostly control & io code. S... | NanoCAD-master | cad/src/analysis/ESP/NanoHiveUtils.py |
# Copyright 2005-2009 Nanorex, Inc. See LICENSE file for details.
"""
NanoHive.py - dialog and control code for running ESP (and other?)
calculations using NanoHive
@author: Mark
@version: $Id$
@copyright: 2005-2009 Nanorex, Inc. See LICENSE file for details.
Module classification: has ui/control/ops code; put in u... | NanoCAD-master | cad/src/analysis/ESP/NanoHive.py |
# -*- coding: utf-8 -*-
# Copyright 2005-2007 Nanorex, Inc. See LICENSE file for details.
# Form implementation generated from reading ui file 'NanoHiveDialog.ui'
#
# Created: Wed Sep 20 10:17:46 2006
# by: PyQt4 UI code generator 4.0.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import ... | NanoCAD-master | cad/src/analysis/ESP/NanoHiveDialog.py |
# Copyright 2005-2009 Nanorex, Inc. See LICENSE file for details.
"""
files_nh.py
@author; Mark
@version: $Id$
@copyright: 2005-2009 Nanorex, Inc. See LICENSE file for details.
History:
Created by Mark.
"""
from analysis.ESP.NanoHiveUtils import get_nh_simspec_filename
from analysis.ESP.NanoHiveUtils import get_n... | NanoCAD-master | cad/src/analysis/ESP/files_nh.py |
# Copyright 2005-2009 Nanorex, Inc. See LICENSE file for details.
"""
GamessProp.py
@author: Mark
@version: $Id$
@copyright: 2005-2009 Nanorex, Inc. See LICENSE file for details.
"""
import os
from PyQt4.Qt import QDialog
from PyQt4.Qt import QButtonGroup
from PyQt4.Qt import QAbstractButton
from PyQt4.Qt import S... | NanoCAD-master | cad/src/analysis/GAMESS/GamessProp.py |
# Copyright 2004-2007 Nanorex, Inc. See LICENSE file for details.
"""
files_gms.py -- reading and writing GAMESS files
@author: Mark
@version: $Id$
@copyright: 2004-2007 Nanorex, Inc. See LICENSE file for details.
History:
GAMESS file IO was part of GamessJob.py until I moved it here
to make it more modular and co... | NanoCAD-master | cad/src/analysis/GAMESS/files_gms.py |
# -*- coding: utf-8 -*-
# Copyright 2005-2007 Nanorex, Inc. See LICENSE file for details.
# Form implementation generated from reading ui file 'JobManagerDialog.ui'
#
# Created: Wed Sep 20 08:10:41 2006
# by: PyQt4 UI code generator 4.0.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 impor... | NanoCAD-master | cad/src/analysis/GAMESS/JobManagerDialog.py |
# Copyright 2005-2009 Nanorex, Inc. See LICENSE file for details.
"""
GamessJob.py -- This is the GAMESS Job parms default settings.
@author: Mark
@version: $Id$
@copyright: 2005-2009 Nanorex, Inc. See LICENSE file for details.
Module classification: this is a kind of SimJob specialized
for running a GAMESS simulat... | NanoCAD-master | cad/src/analysis/GAMESS/GamessJob.py |
NanoCAD-master | cad/src/analysis/GAMESS/__init__.py | |
# -*- coding: utf-8 -*-
# Copyright 2005-2007 Nanorex, Inc. See LICENSE file for details.
# Form implementation generated from reading ui file 'C:\Atom\qt4\cad\src\GamessPropDialog.ui'
#
# Created: Fri May 04 10:49:03 2007
# by: PyQt4 UI code generator 4.1.1
#
# WARNING! All changes made in this file will be los... | NanoCAD-master | cad/src/analysis/GAMESS/GamessPropDialog.py |
# Copyright 2005-2007 Nanorex, Inc. See LICENSE file for details.
"""
JobManager.py -
@author: Mark
@version: $Id$
@copyright: 2005-2007 Nanorex, Inc. See LICENSE file for details.
Module classification: [bruce 071214, 080104]
This contains ui code, operations code (on a set of jobs stored
partly in the filesyste... | NanoCAD-master | cad/src/analysis/GAMESS/JobManager.py |
# Copyright 2005-2008 Nanorex, Inc. See LICENSE file for details.
"""
jig_Gamess.py
@author: Mark
@version: $Id$
@copyright: 2005-2008 Nanorex, Inc. See LICENSE file for details.
"""
import sys
from model.jigs import Jig
from graphics.drawing.drawers import drawwirecube
from graphics.rendering.povray.povheader imp... | NanoCAD-master | cad/src/analysis/GAMESS/jig_Gamess.py |
NanoCAD-master | cad/src/commandSequencer/__init__.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.