Skip to content

Commit 7f8f65c

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

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

flowermd/library/forcefields.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -601,17 +601,17 @@ def __init__(
601601
lpar,
602602
lperp,
603603
r_cut,
604-
#bond_k,
605-
#bond_r0,
604+
# bond_k,
605+
# bond_r0,
606606
angle_k=None,
607607
angle_theta0=None,
608608
):
609609
self.epsilon = epsilon
610610
self.lperp = lperp
611611
self.lpar = lpar
612612
self.r_cut = r_cut
613-
#self.bond_k = bond_k
614-
#self.bond_r0 = bond_r0
613+
# self.bond_k = bond_k
614+
# self.bond_r0 = bond_r0
615615
self.angle_k = angle_k
616616
self.angle_theta0 = angle_theta0
617617
hoomd_forces = self._create_forcefield()
@@ -620,10 +620,10 @@ def __init__(
620620
def _create_forcefield(self):
621621
forces = []
622622
# Bonds
623-
#bond = hoomd.md.bond.Harmonic()
624-
#bond.params["A-A"] = dict(k=self.bond_k, r0=self.bond_r0)
625-
#bond.params["B-B"] = dict(k=0, r0=self.lpar)
626-
#forces.append(bond)
623+
# bond = hoomd.md.bond.Harmonic()
624+
# bond.params["A-A"] = dict(k=self.bond_k, r0=self.bond_r0)
625+
# bond.params["B-B"] = dict(k=0, r0=self.lpar)
626+
# forces.append(bond)
627627

628628
# Angles
629629
if all([self.angle_k, self.angle_theta0]):

flowermd/library/polymers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def _build(self, length):
314314
# Build up ellipsoid bead
315315
bead = mb.Compound(name="ellipsoid")
316316
head = mb.Compound(
317-
pos=(0, 0, self.lpar), name="_H", mass=self.bead_mass / 2
317+
pos=(0, 0, self.lpar), name="_H", mass=self.bead_mass / 2
318318
)
319319
center = mb.Compound(pos=(0, 0, 0), name="_C", mass=self.bead_mass / 2)
320320
bead.add([center, head])

flowermd/utils/constraints.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ def set_bond_constraints(snapshot, bond_type, constrain_value, tolerance=1e-5):
1010
constraint_values = []
1111
constraint_groups = []
1212
bond_type_id = snapshot.bonds.types.index(bond_type)
13-
bond_indices = np.where(snapshot.bonds.typeid == np.array(bond_type_id))[0].astype(int)
13+
bond_indices = np.where(snapshot.bonds.typeid == np.array(bond_type_id))[
14+
0
15+
].astype(int)
1416
for idx in bond_indices:
1517
group = snapshot.bonds.group[idx]
16-
bond_len = np.linalg.norm(snapshot.particles.position[group[1]] - snapshot.particles.position[group[0]])
18+
bond_len = np.linalg.norm(
19+
snapshot.particles.position[group[1]]
20+
- snapshot.particles.position[group[0]]
21+
)
1722
if not np.isclose(constrain_value, bond_len, atol=tolerance):
1823
raise ValueError("Values found not within the given tolerance")
1924
constraint_values.append(constrain_value)
2025
constraint_groups.append(group)
21-
26+
2227
snapshot.constraints.N = len(constraint_values)
2328
snapshot.constraints.value = constraint_values
2429
snapshot.constraints.group = constraint_groups

0 commit comments

Comments
 (0)