From 3a06f245275ef92884790a56aed06739934f175c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 18:40:56 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- gmso/external/convert_hoomd.py | 6 ++---- gmso/tests/test_hoomd.py | 12 ++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gmso/external/convert_hoomd.py b/gmso/external/convert_hoomd.py index 19f287fd..62cfaffa 100644 --- a/gmso/external/convert_hoomd.py +++ b/gmso/external/convert_hoomd.py @@ -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) @@ -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] diff --git a/gmso/tests/test_hoomd.py b/gmso/tests/test_hoomd.py index 5c2dbc3e..8990202d 100644 --- a/gmso/tests/test_hoomd.py +++ b/gmso/tests/test_hoomd.py @@ -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") @@ -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):