Skip to content

Commit b32109a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7fe124d commit b32109a

File tree

2 files changed

+37
-35
lines changed

2 files changed

+37
-35
lines changed

grits/finegrain.py

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,41 @@ def backmap_snapshot_to_compound(
2323
):
2424
"""Backmap a fine-grained snapshot onto a coarse one.
2525
26-
Creates a fine-grained compound from a coarse one using the given parameters.
26+
Creates a fine-grained compound from a coarse one using the given parameters.
2727
28-
Parameters
29-
----------
30-
snapshot : gsd.hoomd.Frame
31-
one frame of gsd trajectory
28+
Parameters
29+
----------
30+
snapshot : gsd.hoomd.Frame
31+
one frame of gsd trajectory
3232
33-
bead_mapping : string, default None
34-
SMILES string of fine-grain monomer
33+
bead_mapping : string, default None
34+
SMILES string of fine-grain monomer
3535
36-
bond_head_index : list of int, default None
37-
index of polymer reaction, choose head to orient chain
36+
bond_head_index : list of int, default None
37+
index of polymer reaction, choose head to orient chain
3838
39-
bond_tail_index : list of int, default None
40-
index of polymer reaction, choose tail to orient chain
39+
bond_tail_index : list of int, default None
40+
index of polymer reaction, choose tail to orient chain
4141
42-
library_key : string, default None
43-
key to dictionary, reactant_dict, with known bead_mapping, bond_head_index, and bond_tail_index
42+
library_key : string, default None
43+
key to dictionary, reactant_dict, with known bead_mapping, bond_head_index, and bond_tail_index
4444
45-
ref_distance : float, default None
46-
distance between monomers
45+
ref_distance : float, default None
46+
distance between monomers
4747
48-
<<<<<<< HEAD
49-
energy_minimize (bool) : Option to run a mbuild energy minimization.
48+
<<<<<<< HEAD
49+
energy_minimize (bool) : Option to run a mbuild energy minimization.
5050
51-
=======
52-
energy_minimize : bool, default False
53-
Option to run a mbuild energy minimization.
54-
55-
>>>>>>> 2785a5d (updating format for doc strings)
51+
=======
52+
energy_minimize : bool, default False
53+
Option to run a mbuild energy minimization.
5654
57-
Returns
58-
-------
59-
:py:class:`mbuild.Compound`
60-
The atomistic structure mapped onto the coarse-grained one.
55+
>>>>>>> 2785a5d (updating format for doc strings)
56+
57+
Returns
58+
-------
59+
:py:class:`mbuild.Compound`
60+
The atomistic structure mapped onto the coarse-grained one.
6161
"""
6262
# TODO
6363
# assert all 3 dicts have the same keys
@@ -98,7 +98,9 @@ def backmap_snapshot_to_compound(
9898
for l, particle in enumerate(comp.particles()):
9999
if l == k:
100100
remove_atoms.append(particle)
101-
if len(bond_head_index[mapping]) > 1: #repeated if statement if reacting group is listed for head index
101+
if (
102+
len(bond_head_index[mapping]) > 1
103+
): # repeated if statement if reacting group is listed for head index
102104
extra_head_particles = []
103105
extra_head_particles = bond_head_index[mapping][1:]
104106
for k in extra_head_particles:

grits/tests/test_finegrain.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_backmap_snap_smiles(snap):
2929
bead_mapping = {"A": "C=CC1=CC=CC=C1"} # Mapping one A bead to 1 Polystyrene monomer
3030
head_indices = {"A": [10]}
3131
tail_indices = {"A": [9]}
32-
32+
3333
fg_comp = backmap_snapshot_to_compound(
3434
snapshot=snap,
3535
bead_mapping=bead_mapping,
@@ -38,7 +38,7 @@ def test_backmap_snap_smiles(snap):
3838
ref_distance=0.3438,
3939
energy_minimize=False
4040
)
41-
41+
4242
assert fg_comp.particles == snap.particles
4343
assert fg_comp.bonds == snap.bonds
4444

@@ -49,15 +49,15 @@ def test_backmap_snap_library(snap):
4949
ref_distance=0.3438,
5050
energy_minimize=False
5151
)
52-
52+
5353
assert fg_comp.particles == snap.particles
5454
assert fg_comp.bonds == snap.bonds
55-
55+
5656
def test_backmap_snap_lists(snap):
5757
bead_mapping = {"A": "C[C@@H](C(=O)O)N"} # Mapping one A bead to 1 Polyalanine monomer
5858
head_indices = {"A":[4,10]}
5959
tail_indices = {"A":[12]}
60-
60+
6161
fg_comp = backmap_snapshot_to_compound(
6262
snapshot=snap,
6363
bead_mapping=bead_mapping,
@@ -66,7 +66,7 @@ def test_backmap_snap_lists(snap):
6666
ref_distance=0.3438,
6767
energy_minimize=False
6868
)
69-
69+
7070
assert fg_comp.particles == snap.particles
7171
assert fg_comp.bonds == snap.bonds
7272

@@ -75,7 +75,7 @@ def test_backmap_snap_not_int(snap):
7575
bead_mapping = {"A": "C[C@@H](C(=O)O)N"} # Mapping one A bead to 1 Polyalanine monomer
7676
head_indices = {"A":[4.5,10]}
7777
tail_indices = {"A":[12]}
78-
78+
7979
fg_comp = backmap_snapshot_to_compound(
8080
snapshot=snap,
8181
bead_mapping=bead_mapping,
@@ -84,4 +84,4 @@ def test_backmap_snap_not_int(snap):
8484
ref_distance=0.3438,
8585
energy_minimize=False
8686
)
87-
pass #non-int should break code
87+
pass #non-int should break code

0 commit comments

Comments
 (0)