Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polymer class revamp #851

Merged
merged 72 commits into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
0668608
added a couple new functions, moved existing code into build function
chrisjonesBSU Feb 3, 2021
3edbabb
added some doc strings
Feb 3, 2021
7463549
added a default value to the port labels
chrisjonesBSU Feb 3, 2021
8b80df7
reworked the _add_port function
Feb 5, 2021
25161ef
saving my progress with the add_end_groups function
Feb 5, 2021
e0f5224
made progress with end group funcitonality
Feb 6, 2021
02b3f44
removing a couple print statements
Feb 6, 2021
17819ae
added 2 new attributes to port class
chrisjonesBSU Feb 11, 2021
c1b1575
removed changes from port.py, commented out orientation and separatio…
chrisjonesBSU Feb 11, 2021
658e1f8
changed method of removing hydrogens, added n_monomers var for findin…
Feb 18, 2021
57f4513
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
Feb 19, 2021
7c2c178
adding to the doc strings
chrisjonesBSU Feb 22, 2021
b433079
Merge branch 'feat/polymer' of github.com:chrisjonesBSU/mbuild into f…
Feb 24, 2021
7b6ccc0
added update_separation function
Feb 24, 2021
650d899
update orientation func; separation property func
Feb 24, 2021
9b4d93b
added the up subports to the rotations
Feb 25, 2021
67b6f28
fixed the change_orientation function
Feb 25, 2021
ccd312f
fix handling when their is no anchor particle
Feb 25, 2021
80a54b8
fix typo
jennyfothergill Mar 4, 2021
41aec95
docstring: separation is None when port has no anchor
jennyfothergill Mar 4, 2021
33b7eca
added 3 unit tests
Mar 15, 2021
a8fb3b9
remove the port updating stuff I was trying to use
Mar 15, 2021
c0b3a6c
Merge branch 'feat/port' into feat/polymer
chrisjonesBSU Mar 15, 2021
c4c894f
updating port separations for end groups
chrisjonesBSU Mar 15, 2021
a111ebf
fix the way clone is being called
Mar 15, 2021
df35343
added some doc strings and comments
Mar 16, 2021
e71fc53
updated doc strings
Mar 22, 2021
90b5eed
including jupyter notebook example and walk through
Mar 22, 2021
77adbbb
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
Mar 22, 2021
07c016c
example notebook ready
Mar 22, 2021
8588666
added to recipe examples
Mar 22, 2021
1120d5f
expanded end_group options
chrisjonesBSU Mar 29, 2021
031d5eb
update alkane recipe to make tests pass
jennyfothergill Mar 29, 2021
96c675b
cleaned up if statements when updating head/tail ports
chrisjonesBSU Mar 30, 2021
417c58b
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
jennyfothergill Apr 1, 2021
11a082c
remove trailing whitespace
jennyfothergill Apr 1, 2021
a1b6654
allow use of compound with existing ports to be specified in init
jennyfothergill Apr 5, 2021
5d5340f
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
jennyfothergill Apr 6, 2021
db0d723
update alkane to new schema
jennyfothergill Apr 6, 2021
a169da9
update tests
jennyfothergill Apr 6, 2021
5208f66
blacked, changed how head/tail port work
jennyfothergill Apr 6, 2021
cfdfbcf
remove debug print
jennyfothergill Apr 6, 2021
31a9bd9
update notebook
jennyfothergill Apr 6, 2021
0a44c85
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
chrisjonesBSU Apr 6, 2021
c98bfb5
Merge branch 'feat/polymer' of github.com:chrisjonesBSU/mbuild into f…
chrisjonesBSU Apr 6, 2021
54064ec
update notebook
jennyfothergill Apr 6, 2021
2265a00
clear nb
jennyfothergill Apr 6, 2021
95e10b4
add back add_hydrogens
jennyfothergill Apr 6, 2021
9975ec2
add add_hydrogens=False
jennyfothergill Apr 6, 2021
3e937de
add_hydrogens=False, all tests pass
jennyfothergill Apr 6, 2021
9a5b39a
Merge branch 'feat/polymer' of github.com:chrisjonesBSU/mbuild into f…
jennyfothergill Apr 6, 2021
bda023c
Merge pull request #1 from jennyfothergill/feat/polymer
chrisjonesBSU Apr 6, 2021
aea0dde
changed orientation of down port to face opposite direction of up port
chrisjonesBSU Apr 6, 2021
01965ef
Few more examples added to show new functionality
chrisjonesBSU Apr 6, 2021
1e111fc
merge upstream
chrisjonesBSU Apr 14, 2021
deca5b2
adding a few unit tests
chrisjonesBSU Apr 14, 2021
56575f0
removing the example notebook from the PR
chrisjonesBSU Apr 14, 2021
7b7e14a
test for errors, and manually passing in end group compounds
chrisjonesBSU Apr 14, 2021
3eab819
expanded doc strings with more detailed explanations, and some examples
chrisjonesBSU Apr 14, 2021
15d14b4
fix a conflict that was sticking around in the port doc strings
chrisjonesBSU Apr 14, 2021
19cb631
fix formatting in the doc strings
chrisjonesBSU Apr 14, 2021
4bbeec1
Doc strings to explain implementation of sequence in the build function
chrisjonesBSU Apr 15, 2021
707418b
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
Apr 23, 2021
926a570
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
chrisjonesBSU Apr 23, 2021
a06bc72
Merge branch 'feat/polymer' of github.com:chrisjonesBSU/mbuild into f…
chrisjonesBSU Apr 23, 2021
04138b9
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
chrisjonesBSU Apr 27, 2021
4bf8660
add unit test for value of n < 1
chrisjonesBSU Apr 28, 2021
cdfd80d
2 new tests to test for errors
chrisjonesBSU Apr 28, 2021
0e36cd0
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
jennyfothergill May 13, 2021
883f25f
remove unused imports
jennyfothergill May 13, 2021
ed10425
oops, typo
jennyfothergill May 13, 2021
2608b9d
Merge branch 'master' of github.com:mosdef-hub/mbuild into feat/polymer
chrisjonesBSU May 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mbuild/lib/moieties/ch2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):
self.add(mb.Port(anchor=self[0]), "up")
self["up"].translate([0, 0.07, 0])

self.add(mb.Port(anchor=self[0]), "down")
self.add(mb.Port(anchor=self[0], orientation=[0, -1, 0]), "down")
self["down"].translate([0, -0.07, 0])


Expand Down
40 changes: 14 additions & 26 deletions mbuild/lib/recipes/alkane.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,21 @@ def __init__(self, n=3, cap_front=True, cap_end=True):

# Handle general case of n >= 3
else:
end_groups = [None, None]
# Adjust length of Polmyer for absence of methyl terminations.
if not cap_front:
n += 1
if not cap_end:
n += 1
chain = mb.recipes.Polymer(
CH2(), n=n - 2, port_labels=("up", "down")
)
self.add(chain, "chain")
if cap_front:
self.add(CH3(), "methyl_front")
mb.force_overlap(
move_this=self["chain"],
from_positions=self["chain"]["up"],
to_positions=self["methyl_front"]["up"],
)
else:
# Hoist port label to Alkane level.
self.add(chain["up"], "up", containment=False)

n -= 1
end_groups[0] = CH3()
if cap_end:
self.add(CH3(), "methyl_end")
mb.force_overlap(
self["methyl_end"],
self["methyl_end"]["up"],
self["chain"]["down"],
)
else:
n -= 1
end_groups[1] = CH3()

chain = mb.recipes.Polymer(monomers=[CH2()], end_groups=end_groups)
chain.build(n, add_hydrogens=False)
self.add(chain, "chain")
if not cap_front:
# Hoist port label to Alkane level.
self.add(self["chain"]["up"], "up", containment=False)
if not cap_end:
# Hoist port label to Alkane level.
self.add(chain["down"], "down", containment=False)
self.add(self["chain"]["down"], "down", containment=False)
Loading