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

[pre-commit.ci] pre-commit autoupdate #48

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.9.1
hooks:
- id: black
args: [--line-length=80]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
name: isort (python)
- repo: https://github.com/pycqa/pydocstyle
rev: '6.1.1'
rev: '6.3.0'
hooks:
- id: pydocstyle
exclude: ^(grits/tests/|grits/compounds/|setup.py|docs/)
Expand Down
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
Loading