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 23, 2024
1 parent fdba315 commit 3a06f24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions gmso/external/convert_hoomd.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def _parse_particle_information(
if site.mass
else 1 * base_units["mass"]
)
charges[idx] = (site.charge if site.charge else 0 * u.elementary_charge)
charges[idx] = site.charge if site.charge else 0 * u.elementary_charge
# Check for rigid IDs
rigid_ids = [site.rigid_id for site in top.sites]
rigid_ids_set = set(rigid_ids)
Expand All @@ -311,9 +311,7 @@ def _parse_particle_information(
# TODO: Can we always use "R" here? What if an atom_type is "R"?
unique_types = ["R"] + unique_types
# Rigid particles get type ID 0, move all others up by 1
typeids = np.concatenate(
(np.array([0] * n_rigid), typeids + 1)
)
typeids = np.concatenate((np.array([0] * n_rigid), typeids + 1))
# Update mass list and position list of Frame
for idx, _id in enumerate(rigid_ids_set):
group_indices = np.where(rigid_ids == _id)[0]
Expand Down
12 changes: 6 additions & 6 deletions gmso/tests/test_hoomd.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import forcefield_utilities as ffutils
import hoomd
import numpy as np
import pytest
import unyt as u

from gmso import ForceField
from gmso.external import from_mbuild
from gmso.external.convert_hoomd import to_hoomd_forcefield, to_hoomd_snapshot, to_gsd_snapshot
from gmso.external.convert_hoomd import (
to_gsd_snapshot,
to_hoomd_forcefield,
to_hoomd_snapshot,
)
from gmso.parameterization import apply
from gmso.tests.base_test import BaseTest
from gmso.tests.utils import get_path
from gmso.utils.io import has_hoomd, has_mbuild, import_
from gmso.utils.sorting import sort_connection_strings

if has_hoomd:
hoomd = import_("hoomd")
Expand Down Expand Up @@ -51,9 +54,6 @@ def run_hoomd_nvt(snapshot, forces, vhoomd=4):
return sim





@pytest.mark.skipif(not has_hoomd, reason="hoomd is not installed")
@pytest.mark.skipif(not has_mbuild, reason="mbuild not installed")
class TestGsd(BaseTest):
Expand Down

0 comments on commit 3a06f24

Please sign in to comment.