Skip to content

Commit

Permalink
preliminary filename refactoring; may have added some unneccesary fil…
Browse files Browse the repository at this point in the history
…es produced during testing in the inputs directory
  • Loading branch information
ctk3b committed Jun 20, 2014
1 parent d0ef6b8 commit 2425458
Show file tree
Hide file tree
Showing 243 changed files with 145,905 additions and 457 deletions.
2 changes: 1 addition & 1 deletion ez_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def main(argv, version=DEFAULT_VERSION):
except ImportError:
from easy_install import main
main(list(argv)+[download_setuptools(delay=0)])
sys.exit(0) # try to force an exit
sys.exit(0) # try to forces an exit
else:
if argv:
from setuptools.command.easy_install import main
Expand Down
84 changes: 41 additions & 43 deletions intermol/Atom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,26 @@
Lee <[email protected]>
"""
import intermol.unit as units

from Converter import convert_units
from converter import convert_units


class Atom(object):
__slots__ = ['atomIndex', 'atomName', 'residueIndex', 'residueName',
__slots__ = ['index', 'name', 'residue_index', 'residue_name',
'_position', '_velocity', '_force', '_atomtype', 'bondtype', 'Z',
'cgnr', '_mass', '_charge', 'ptype', '_sigma', '_epsilon']
def __init__(self,
atomIndex,
atomName=None,
residueIndex=-1,
residueName=None):
def __init__(self, index, name=None, residue_index=-1, residue_name=None):
"""Create an Atom object
Args:
atomIndex (int): index of atom in the molecule
atomName (str): name of the atom (eg., N, C, H, O)
residueIndex (int): index of residue in the molecule
residueName (str): name of the residue (eg., THR, CYS)
"""
self.atomIndex = atomIndex
self.atomName = atomName
self.residueIndex = residueIndex
self.residueName = residueName
index (int): index of atom in the molecule
name (str): name of the atom (eg., N, C, H, O)
residue_index (int): index of residue in the molecule
residue_name (str): name of the residue (eg., THR, CYS)
"""
self.index = index
self.name = name
self.residue_index = residue_index
self.residue_name = residue_name
self._position = [0 * units.nanometers,
0 * units.nanometers,
0 * units.nanometers]
Expand All @@ -52,6 +47,31 @@ def __init__(self,
self._sigma = dict()
self._epsilon = dict()

def getAtomType(self, index=None):
"""Gets the atomtype
Args:
index (str): the value corresponding with type precedence (A Type, B Type)
Returns:
atomtype (list, str): Returns the atomtype list or the value at
index if index is specified
"""
if index:
return self._atomtype[index]
return self._atomtype

def setAtomType(self, index, atomtype):
"""Sets the atomtype
Args:
atomtype (str): the atomtype of the atom
index (str): the value corresponding with type precedence (A Type, B Type)
"""
self._atomtype[index] = atomtype



def setSigma(self, index, sigma):
"""Sets the sigma
Expand Down Expand Up @@ -108,28 +128,6 @@ def getCgnr(self, index=None):
return self._cgnr[index]
return self._cgnr

def setAtomType(self, index, atomtype):
"""Sets the atomtype
Args:
atomtype (str): the atomtype of the atom
index (str): the value corresponding with type precedence (A Type, B Type)
"""
self._atomtype[index] = atomtype

def getAtomType(self, index = None):
"""Gets the atomtype
Args:
index (str): the value corresponding with type precedence (A Type, B Type)
Returns:
atomtype (list, str): Returns the atomtype list or the value at
index if index is specified
"""
if index:
return self._atomtype[index]
return self._atomtype

def setPosition(self, x, y, z):
"""Sets the position of the atom
Expand Down Expand Up @@ -242,13 +240,13 @@ def getCharge(self, index=None):
return self._charge

def __repr__(self):
return 'Atom({0}, {1})'.format(self.atomIndex, self.atomName)
return 'Atom({0}, {1})'.format(self.index, self.name)

def __cmp__(self, other):
return self.atomIndex - other.atomIndex
return self.index - other.index

def __eq__(self, other):
return self.atomIndex == other.atomIndex
return self.index == other.index

def __hash__(self):
return hash(self.atomIndex)
return hash(self.index)
87 changes: 0 additions & 87 deletions intermol/Force/__init__.py

This file was deleted.

4 changes: 2 additions & 2 deletions intermol/Molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
Lee <[email protected]>
"""

from Atom import *
from OrderedSet import OrderedSet
from atom import *
from orderedset import OrderedSet

class Molecule(object):
"""An abstract molecule object.
Expand Down
16 changes: 8 additions & 8 deletions intermol/MoleculeType.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from OrderedSet import OrderedSet
from HashMap import HashMap
from orderedset import OrderedSet
from hashmap import HashMap


class MoleculeType(object):
Expand Down Expand Up @@ -48,26 +48,26 @@ def getMolecule(self, molecule):
return get_equivalent(self.moleculeSet, molecule, False)

def addForce(self, force):
"""Add a force to the moleculeType
"""Add a forces to the moleculeType
Args:
force (AbstractForce): Add a force or contraint to the moleculeType
forces (AbstractForce): Add a forces or contraint to the moleculeType
"""
self.forceSet.add(force)

def removeForce(self, force):
"""Remove a force from the moleculeType
"""Remove a forces from the moleculeType
Args:
force (AbstractForce): Remove a force from the moleculeType
forces (AbstractForce): Remove a forces from the moleculeType
"""
self.forceSet.remove(force)

def getForce(self, force):
"""Get a force from the moleculeType
"""Get a forces from the moleculeType
Args:
force (AbstractForce): Retrieve a force from the moleculeType
forces (AbstractForce): Retrieve a forces from the moleculeType
"""
return get_equivalent(self.forceSet, force, False)

Expand Down
6 changes: 3 additions & 3 deletions intermol/System.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from collections import OrderedDict
import numpy as np

from intermol.MoleculeType import MoleculeType
from intermol.OrderedSet import OrderedSet
from intermol.HashMap import HashMap
from intermol.moleculetype import MoleculeType
from intermol.orderedset import OrderedSet
from intermol.hashmap import HashMap


class System(object):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
sys.path.append('..')

from intermol.Decorators import *
from AbstractPairType import *
from intermol.decorators import *
from abstract_pair_type import *

class LJ1PairCR1Type(AbstractPairType):
@accepts_compatible_units(None, None, None, units.kilojoules_per_mole * units.nanometers**(6), units.kilojoules_per_mole * units.nanometers**(12))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
sys.path.append('..')

from intermol.Decorators import *
from AbstractPairType import *
from intermol.decorators import *
from abstract_pair_type import *

class LJ1PairCR23Type(AbstractPairType):
@accepts_compatible_units(None, None, None, units.nanometers, units.kilojoules_per_mole)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

import sys
sys.path.append('..')
from intermol.Decorators import *
from AbstractPairType import *
from intermol.decorators import *
from abstract_pair_type import *

class LJ2PairCR1Type(AbstractPairType):
@accepts_compatible_units(None, None, None, None, units.elementary_charge, units.elementary_charge, units.kilojoules_per_mole * units.nanometers**(6), units.kilojoules_per_mole * units.nanometers**(12))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
sys.path.append('..')

from intermol.Decorators import *
from AbstractPairType import *
from intermol.decorators import *
from abstract_pair_type import *

class LJ2PairCR23Type(AbstractPairType):
@accepts_compatible_units(None, None, None, None, units.elementary_charge, units.elementary_charge, units.nanometers, units.kilojoules_per_mole)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
sys.path.append('..')

from intermol.Decorators import *
from AbstractPairType import *
from intermol.decorators import *
from abstract_pair_type import *

class LJNBPairCR1Type(AbstractPairType):
@accepts_compatible_units(None, None, None, units.elementary_charge, units.elementary_charge, units.kilojoules_per_mole * units.nanometers**(6), units.kilojoules_per_mole * units.nanometers**(12))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
sys.path.append('..')

from intermol.Decorators import *
from AbstractPairType import *
from intermol.decorators import *
from abstract_pair_type import *

class LJNBPairCR23Type(AbstractPairType):
@accepts_compatible_units(None, None, None, units.elementary_charge, units.elementary_charge, units.nanometers, units.kilojoules_per_mole)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from intermol.Decorators import *
from AbstractDihedralType import *
from intermol.decorators import *
from abstract_dihedral_type import *

class RBDihedralType(AbstractDihedralType):

Expand Down
Loading

0 comments on commit 2425458

Please sign in to comment.