Skip to content

Commit

Permalink
Add details to doc strings in hoomd and sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
CalCraven committed Sep 21, 2023
1 parent 076de2c commit 235016d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
10 changes: 4 additions & 6 deletions gmso/external/convert_hoomd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,11 +1108,6 @@ def _parse_dihedral_forces(
expected_unitsDict[group] = potential_refs[group][
"expected_parameters_dimensions"
]
# groups[group] = _convert_connection_params_units(
# groups[group],
# expected_units_dim,
# base_units,
# )
dtype_group_map = {
"OPLSTorsionPotential": {
"container": hoomd.md.dihedral.OPLS,
Expand Down Expand Up @@ -1176,7 +1171,10 @@ def _parse_dihedral_forces(
base_units=base_units,
)
)
raise ValueError
else:
raise GMSOError(

Check warning on line 1175 in gmso/external/convert_hoomd.py

View check run for this annotation

Codecov / codecov/patch

gmso/external/convert_hoomd.py#L1175

Added line #L1175 was not covered by tests
f"Current version of HOOMD-blue, {hoomd_version}. is not supported. Please updated for version 3.8 or later."
)
return dihedral_forces


Expand Down
21 changes: 20 additions & 1 deletion gmso/utils/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,26 @@ def convert_params_units(
expected_units_dim,
base_units,
):
"""Convert parameters' units in the potential to that specified in the base_units."""
"""Convert parameters' units in the potential to that specified in the base_units.
Parameters
----------
potentials : list
Set of potentials to apply the conversion to.
expected_units_dim : dict
The dimensionality expected for all parameters in the potential. This allows
the given dimensions to be converted to via the base_units specified in the
unit system.
base_units : dict
The units to use for conversion. Must have keys of "length", "energy",
and "mass". These are the base units any parameter will be converted into.
Returns
-------
converted_potentials : list
the input potentials converted into the base units given by
base_units `dict`.
"""
converted_potentials = list()
for potential in potentials:
converted_params = dict()
Expand Down

0 comments on commit 235016d

Please sign in to comment.