Skip to content

Commit

Permalink
fixed renaming in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ctk3b committed Feb 13, 2015
1 parent 465b547 commit 43b6471
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 20 deletions.
6 changes: 3 additions & 3 deletions mbuild/examples/pmpc/brush.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
from initiator import Initiator


class PMPC(Compound):
class Brush(Compound):
""" """
def __init__(self, chain_length=4, alpha=pi/4):
super(PMPC, self).__init__(self)
super(Brush, self).__init__(self)

# Add parts
self.add(Silane(), 'silane')
Expand All @@ -30,5 +30,5 @@ def __init__(self, chain_length=4, alpha=pi/4):
self.add(self.silane.down, label='down', containment=False)

if __name__ == "__main__":
pmpc = PMPC(chain_length=1, alpha=pi/4)
pmpc = Brush(chain_length=1, alpha=pi/4)
pmpc.visualize(show_ports=True)
2 changes: 1 addition & 1 deletion mbuild/examples/pmpc/initiator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self):
super(Initiator, self).__init__(self)

# Look for data file in same directory as this python module.
self.append_from_file('initiator.pdb')
self.append_from_file('initiator.pdb', relative_to_module=self.__module__)

# Transform the coordinate system such that the two carbon atoms
# that are part of the backbone are on the y axis, C_1 at the origin.
Expand Down
2 changes: 1 addition & 1 deletion mbuild/examples/pmpc/mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def __init__(self, alpha=0):
super(MPC, self).__init__(self)

# Look for data file in same directory as this python module.
self.append_from_file('mpc.pdb')
self.append_from_file('mpc.pdb', relative_to_module=self.__module__)

# Transform the coordinate system of mpc such that the two carbon atoms
# that are part of the backbone are on the y axis, c_backbone at the origin.
Expand Down
26 changes: 14 additions & 12 deletions mbuild/examples/pmpc/pmpc_brush_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
from mbuild.tools.parameterize.atomtyper import find_atomtypes
from mbuild.tools.tiled_compound import TiledCompound

from mbuild.components.surfaces.betacristobalite import Betacristobalite
from brush import Brush
from mbuild.components.atoms.H import H
from pmpc import PMPC
from mbuild.components.surfaces.betacristobalite import Betacristobalite
from mpc import MPC


class PMPCLayer(Compound):
Expand All @@ -21,19 +22,20 @@ def __init__(self, mask, tile_x=1, tile_y=1, chain_length=4, alpha=pi/4):
tc = TiledCompound(surface, tile_x, tile_y, 1, kind="tiled_surface")
self.add(tc, 'tiled_surface')

pmpc = PMPC(chain_length=chain_length, alpha=alpha)
brush = Brush(chain_length=chain_length, alpha=alpha)
hydrogen = H()

apply_mask(self.tiled_surface, pmpc, mask, backfill=hydrogen)
apply_mask(self.tiled_surface, brush, mask, backfill=hydrogen)

def main():
mask = random_mask_2d(1)
return PMPCLayer(mask=mask, chain_length=3, alpha=pi/4, tile_x=1, tile_y=1)

if __name__ == "__main__":
mask = random_mask_2d(1)
pmpc_layer = PMPCLayer(mask=mask, chain_length=3, alpha=pi/4, tile_x=1, tile_y=1)
pmpc_layer = main()
pmpc_layer.visualize(show_ports=True)
# find_atomtypes(pmpc_layer)
#
# pmpc_layer = pmpc_layer.to_trajectory(chain_types=[Betacristobalite, PMPC],
# residue_types=[MPC])
# pmpc_layer.topology.find_forcefield_terms()
# pmpc_layer.save(filename='brush_layer.top')
find_atomtypes(pmpc_layer)
pmpc_layer = pmpc_layer.to_trajectory(chain_types=[Betacristobalite, Brush],
residue_types=[MPC])
pmpc_layer.topology.find_forcefield_terms()
pmpc_layer.save(filename='brush_layer.top')
2 changes: 1 addition & 1 deletion mbuild/examples/reload/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from numpy import pi

from mbuild.examples.pmpc_brush_layer.brush import Brush
from mbuild.examples.pmpc.brush import Brush
from mbuild.coordinate_transform import rotate_around_z


Expand Down
4 changes: 2 additions & 2 deletions mbuild/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def test_methane(self):
import mbuild.examples.methane.methane as example
example.main()

def test_pmpc_brush_layer(self):
import mbuild.examples.pmpc_brush_layer.pmpc_brush_layer as example
def test_pmpc(self):
import mbuild.examples.pmpc.pmpc_brush_layer as example
example.main()

def test_reload(self):
Expand Down

0 comments on commit 43b6471

Please sign in to comment.