From 6b18346f586a0f2933d0334fb8eb960014a7f17c Mon Sep 17 00:00:00 2001 From: Chris Jones <50423140+chrisjonesBSU@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:31:03 -0600 Subject: [PATCH] Fix hoomd version handling in `convert_hoomd.py` (#828) * move hoomd version var under if statement * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- gmso/external/convert_hoomd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gmso/external/convert_hoomd.py b/gmso/external/convert_hoomd.py index 6779dafe..1eb7b8ce 100644 --- a/gmso/external/convert_hoomd.py +++ b/gmso/external/convert_hoomd.py @@ -31,6 +31,10 @@ if has_hoomd: import hoomd + hoomd_version = hoomd.version.version.split(".") +else: + hoomd_version = None + # Note, charge will always be assumed to be in elementary_charge MD_UNITS = { "energy": u.kJ / u.mol, @@ -44,8 +48,6 @@ "mass": u.g / u.mol, # aka amu } -hoomd_version = hoomd.version.version.split(".") - def to_gsd_snapshot( top,