New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document mode in md.pair.Pair #974 #1015
Conversation
The Checks claim that pair.py was changed by the hook (i.e. white space was deleted) but I cannot see this deletion in the Files Changed. How are changes made by the hook reflected in the file on this PR/is there a further action I need to take? |
@AlainKadar Some of our other repos have |
It looks like the issue preventing pre-commit.ci from working on HOOMD is now fixed: pre-commit-ci/issues#53 . I will enable it and see if it works. It will push changes for all the fixers except for clang-format which we still need to run manually until pre-commit-ci/issues#63 is solved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I have a few change requests.
hoomd/md/pair/pair.py
Outdated
Use the `params` dictionary to set | ||
potential coefficients. The coefficients must be set per unique pair of | ||
particle types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the `params` dictionary to set | |
potential coefficients. The coefficients must be set per unique pair of | |
particle types. |
Most of the potentials don't have this sentence any longer. Since we are updating them for consistency in this PR, let's remove this from all of them. The requirement is implicit in the definition of the TypeParameter
type of params
and it is covered in the tutorial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
References/formatting fixed, thanks for the feedback.
Co-authored-by: Joshua A. Anderson <joaander@umich.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments attached -- overall this is fine and I don't need to re-review.
hoomd/md/pair/pair.py
Outdated
*mode*, *optional*: defaults to ``none``. | ||
Possible values: ``none``, ``shift``, ``xplor`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String literal values should be wrapped in quotes. If this change is accepted, please also update the formatting in the docstring above these lines.
*mode*, *optional*: defaults to ``none``. | |
Possible values: ``none``, ``shift``, ``xplor`` | |
*mode*, *optional*: defaults to ``"none"``. | |
Possible values: ``"none"``, ``"shift"``, ``"xplor"`` |
hoomd/md/pair/pair.py
Outdated
@@ -323,7 +326,7 @@ class SLJ(Pair): | |||
nlist (`hoomd.md.nlist.NList`): Neighbor list | |||
r_cut (float): Default cutoff radius (in distance units). | |||
r_on (float): Default turn-on radius (in distance units). | |||
mode (str): Energy shifting/smoothing mode | |||
mode (str): Energy shifting mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these attributes end with periods and others do not. Try to make that consistent across all force parameter docstrings. Specifically I see periods missing from mode
and nlist
(nlist (`hoomd.md.nlist.NList`): Neighbor list
).
Also it's unclear to me why the word "smoothing" was deleted here but kept in the description below.
mode (str): Energy shifting mode | |
mode (str): Energy shifting/smoothing mode. |
@@ -428,9 +429,7 @@ class Yukawa(Pair): | |||
\end{eqnarray*} | |||
|
|||
See `Pair` for details on how forces are calculated and the available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor nit, feel free to ignore this: the last word on this line, "available," is wrapped onto the next line in several of the Pair docstrings. Consistency might help future documentation writers that perform find/replace operations.
hoomd/md/pair/pair.py
Outdated
@@ -635,9 +629,7 @@ class DPD(Pair): | |||
utilize the DPD functionality in your work. | |||
|
|||
`DPD` does not implement and energy shift / smoothing modes due to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is supposed to say "any," but I suppose it might support the default behavior of "none"
?
`DPD` does not implement and energy shift / smoothing modes due to the | |
`DPD` does not implement any energy shift / smoothing modes due to the |
hoomd/md/pair/pair.py
Outdated
@@ -718,9 +710,7 @@ class DPDConservative(Pair): | |||
|
|||
|
|||
`DPDConservative` does not implement and energy shift / smoothing modes due |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`DPDConservative` does not implement and energy shift / smoothing modes due | |
`DPDConservative` does not implement any energy shift / smoothing modes due |
hoomd/md/pair/pair.py
Outdated
of the dpd thermostat pair force with other integrators will result in | ||
unphysical behavior. | ||
|
||
DPDLJ does not support xplor smoothing mode. See `Pair` for details on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DPDLJ does not support xplor smoothing mode. See `Pair` for details on | |
`DPDLJ` does not support smoothing with ``mode="xplor"``. See `Pair` for details on |
hoomd/md/pair/pair.py
Outdated
@@ -1454,7 +1435,7 @@ class LJ0804(Pair): | |||
nlist (`hoomd.md.nlist.NList`): Neighbor list | |||
r_cut (float): Default cutoff radius (in distance units). | |||
r_on (float): Default turn-on radius (in distance units). | |||
mode (str): energy shifting/smoothing mode | |||
mode (str): Energy shifting/smoothing mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode (str): Energy shifting/smoothing mode | |
mode (str): Energy shifting/smoothing mode. |
hoomd/md/pair/pair.py
Outdated
@@ -1398,7 +1380,7 @@ class LJ1208(Pair): | |||
nlist (`hoomd.md.nlist.NList`): Neighbor list | |||
r_cut (float): Default cutoff radius (in distance units). | |||
r_on (float): Default turn-on radius (in distance units). | |||
mode (str): energy shifting/smoothing mode | |||
mode (str): Energy shifting/smoothing mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode (str): Energy shifting/smoothing mode | |
mode (str): Energy shifting/smoothing mode. |
hoomd/md/pair/pair.py
Outdated
@@ -1343,7 +1326,7 @@ class Buckingham(Pair): | |||
nlist (`hoomd.md.nlist.NList`): Neighbor list | |||
r_cut (float): Default cutoff radius (in distance units). | |||
r_on (float): Default turn-on radius (in distance units). | |||
mode (str): energy shifting/smoothing mode | |||
mode (str): Energy shifting/smoothing mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode (str): Energy shifting/smoothing mode | |
mode (str): Energy shifting/smoothing mode. |
hoomd/md/pair/pair.py
Outdated
@@ -1174,7 +1158,7 @@ class ReactionField(Pair): | |||
nlist (`hoomd.md.nlist.NList`): Neighbor list | |||
r_cut (float): Default cutoff radius (in distance units). | |||
r_on (float): Default turn-on radius (in distance units). | |||
mode (str): energy shifting/smoothing mode | |||
mode (str): Energy shifting/smoothing mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode (str): Energy shifting/smoothing mode | |
mode (str): Energy shifting/smoothing mode. |
Description
Added
mode
attribute to Pair base class. Also formatted mode attribute in each pair potentialMotivation and context
Mode attribute was missing in
md.pair.Pair
documentation. There were also inconsistencies in pair potentials documentation.Resolves #974
How has this been tested?
Documentation was locally rendered in HTML.
Change log
Checklist:
sphinx-doc/credits.rst
) in the pull request source branch.