Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 25, 2023
1 parent d7cfe68 commit 39b8f99
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions grits/tests/test_coarsegrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_initanisomethane(self, methane):
assert np.isclose(cg_methane.mass, 16.043, atol=1e-5)
# in methane we expect all default orientations
for particle in cg_methane.particles():
assert np.allclose(particle.orientation, np.array([0,0,0,1]))
assert np.allclose(particle.orientation, np.array([0, 0, 0, 1]))

def test_initp3ht(self, p3ht):
cg_beads = {"_B": p3ht_backbone, "_S": propyl}
Expand Down Expand Up @@ -78,7 +78,7 @@ def test_initanisop3ht(self, p3ht):
assert np.isclose(cg_p3ht[17].mass, 43.089, atol=1e-5)
# larger beads should have non-default orientations
for particle in cg_p3ht.particles():
assert not np.allclose(particle.orientation, np.array([0,0,0,1]))
assert not np.allclose(particle.orientation, np.array([0, 0, 0, 1]))

def test_initp3htoverlap(self, p3ht):
cg_beads = {"_B": p3ht_backbone, "_S": propyl}
Expand All @@ -96,7 +96,9 @@ def test_initp3htoverlap(self, p3ht):
def test_initanisop3htoverlap(self, p3ht):
cg_beads = {"_B": p3ht_backbone, "_S": propyl}

cg_p3ht = CG_Compound(p3ht, cg_beads, allow_overlap=True, aniso_beads=True)
cg_p3ht = CG_Compound(
p3ht, cg_beads, allow_overlap=True, aniso_beads=True
)

assert cg_p3ht.n_particles == 48
assert isinstance(cg_p3ht, CG_Compound)
Expand All @@ -106,7 +108,7 @@ def test_initanisop3htoverlap(self, p3ht):
assert "_S" in types
assert len(types) == 2
for particle in cg_p3ht.particles():
assert not np.allclose(particle.orientation, np.array([0,0,0,1]))
assert not np.allclose(particle.orientation, np.array([0, 0, 0, 1]))

def test_initmapp3ht(self, p3ht, p3ht_mapping):
cg_p3ht = CG_Compound(p3ht, mapping=p3ht_mapping)
Expand All @@ -130,7 +132,7 @@ def test_initmapanisop3ht(self, p3ht, p3ht_mapping):
assert "_S" in types
assert len(types) == 2
for particle in cg_p3ht.particles():
assert not np.allclose(particle.orientation, np.array([0,0,0,1]))
assert not np.allclose(particle.orientation, np.array([0, 0, 0, 1]))

def test_initmapmethane(self, methane, methane_mapping):
cg_methane = CG_Compound(methane, mapping=methane_mapping)
Expand All @@ -143,7 +145,9 @@ def test_initmapmethane(self, methane, methane_mapping):
assert len(types) == 1

def test_initmapanisomethane(self, methane, methane_mapping):
cg_methane = CG_Compound(methane, mapping=methane_mapping, aniso_beads=True)
cg_methane = CG_Compound(
methane, mapping=methane_mapping, aniso_beads=True
)

assert cg_methane.n_particles == 1
assert isinstance(cg_methane, CG_Compound)
Expand All @@ -152,7 +156,7 @@ def test_initmapanisomethane(self, methane, methane_mapping):
assert "_A" in types
assert len(types) == 1
for particle in cg_methane.particles():
assert np.allclose(particle.orientation, np.array([0,0,0,1]))
assert np.allclose(particle.orientation, np.array([0, 0, 0, 1]))

def test_notfoundsmarts(self, methane):
cg_beads = {"_A": propyl}
Expand Down

0 comments on commit 39b8f99

Please sign in to comment.