From d584ffa8ac69157abe62eeca3e8274cfbb1f7645 Mon Sep 17 00:00:00 2001 From: Chris Jones <50423140+chrisjonesBSU@users.noreply.github.com> Date: Mon, 4 Sep 2023 17:03:05 -0600 Subject: [PATCH] Replace `unyt.amu` with `Unit("amu")` to perserve mass values from mBuild (#759) * Fix amu unit usage from Unyt * remove commented out line * [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_mbuild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gmso/external/convert_mbuild.py b/gmso/external/convert_mbuild.py index 40d2bcfdf..4eef15532 100644 --- a/gmso/external/convert_mbuild.py +++ b/gmso/external/convert_mbuild.py @@ -5,6 +5,7 @@ import numpy as np import unyt as u from boltons.setutils import IndexedSet +from unyt import Unit from gmso.core.atom import Atom from gmso.core.bond import Bond @@ -271,7 +272,7 @@ def _parse_site(site_map, particle, search_method, infer_element=False): ele = search_method(particle.name) if infer_element else None charge = particle.charge * u.elementary_charge if particle.charge else None - mass = particle.mass * u.amu if particle.mass else None + mass = particle.mass * Unit("amu") if particle.mass else None site = Atom( name=particle.name,