-
Notifications
You must be signed in to change notification settings - Fork 50
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
Nanobind port: Order module #1281
Conversation
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 made many suggestions for improvement. I pushed some changes directly that were not practical (or possible) to suggest on GitHub.
freud/order.py
Outdated
@@ -206,58 +175,54 @@ def compute(self, orientations): | |||
Args: | |||
orientations (:math:`\left(N_{particles}, 3 \right)` :class:`numpy.ndarray`): | |||
Orientation vectors for which to calculate the order parameter. | |||
""" # noqa: E501 | |||
""" # noqa: E501 |
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.
We should either increase the line length or reformat the docstrings to fit in the chosen length. noqa: E501
is commonly used throughout freud, so I opened #1292 to track work on this in a future PR.
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.
This has been fixed in the current PR. Other examples can be addressed in a later pass over the Nanobind branch: it should be possible to resolve all cases, but it's hard to know until we try.
Thanks for those fixes - I knew it must be possible to use std::copy in Cubatic.cc, but couldn't find the solution |
Co-authored-by: Joshua A. Anderson <joaander@umich.edu>
Co-authored-by: Joshua A. Anderson <joaander@umich.edu>
Co-authored-by: Joshua A. Anderson <joaander@umich.edu>
Co-authored-by: Joshua A. Anderson <joaander@umich.edu>
Co-authored-by: Joshua A. Anderson <joaander@umich.edu>
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!
Description
Work toward converting the code to nano bind. Currently, the
freud/order/nematic
has been 100% translated (with tests passing).Notes for reviewers:
SolidLiquid
previously allowed passing non-integer solid_threshold values, which seem to have been cast into unsigned ints in the python->c translation. I'm not sure what the "ideal" behavior for this is, but in the interest of not modifying tests (which do supply an incorrect value) I have added some handling on the python side to floor the value and raise a warning.TODOs:
(blocked by clusters module)How Has This Been Tested?
No tests have been modified to ensure the user-facing behavior remains constant.
Screenshots
Types of changes
Checklist: