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 Sep 11, 2023
1 parent a3580c2 commit 20cf8fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions grits/coarsegrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def __init__(
length_scale=length_scale,
mass_scale=mass_scale,
conversion_dict=conversion_dict,
add_hydrogens=add_hydrogens
add_hydrogens=add_hydrogens,
)

# calculate the bead mappings for the entire trajectory
Expand All @@ -499,7 +499,7 @@ def _get_compounds(
length_scale,
mass_scale,
conversion_dict,
add_hydrogens
add_hydrogens,
):
"""Get compounds for each molecule type in the gsd trajectory."""
# Use the first frame to find the coarse-grain mapping
Expand Down Expand Up @@ -527,10 +527,10 @@ def _get_compounds(
for inds in uniq_mol_inds:
l = len(inds)
mb_comp = comp_from_snapshot(
snapshot=snap,
indices=inds,
length_scale=length_scale,
mass_scale=mass_scale
snapshot=snap,
indices=inds,
length_scale=length_scale,
mass_scale=mass_scale,
)
self._compounds.append(
CG_Compound(
Expand Down
4 changes: 2 additions & 2 deletions grits/tests/test_coarsegrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ def test_mass_scale(self, tmp_path):
gsdfile,
beads={"_B": "c1cscc1", "_S": "CCC"},
conversion_dict=amber_dict,
mass_scale=2.0
mass_scale=2.0,
)

cg_gsd = tmp_path / "cg-p3ht.gsd"
system.save(cg_gsd)
with gsd.hoomd.open(cg_gsd, "rb") as cg_traj:
cg_mass = sum(cg_traj[0].particles.mass)
assert np.allclose(cg_mass, init_mass*2, 1e-2)
assert np.allclose(cg_mass, init_mass * 2, 1e-2)

def test_iticp3ht(self, tmp_path):
gsdfile = path.join(asset_dir, "itic-p3ht.gsd")
Expand Down

0 comments on commit 20cf8fb

Please sign in to comment.