-
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
Store and re-use computed neighbor vectors. #738
Conversation
…f re-computing bond vectors from the query points and points.
… prefer isort so I'm ignoring the flake8 warning.
Codecov Report
@@ Coverage Diff @@
## master #738 +/- ##
==========================================
- Coverage 55.68% 55.29% -0.39%
==========================================
Files 16 16
Lines 2462 2407 -55
Branches 34 35 +1
==========================================
- Hits 1371 1331 -40
+ Misses 1077 1063 -14
+ Partials 14 13 -1
Continue to review full report at Codecov.
|
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.
Overall looks good to me. I left a few comments.
@bdice I don't mind the API break, I think that it's probably reasonable for us at this stage. However, I think that since the 1.0 release the project has been much more consistent in adhering to best practices overall, which includes versioning. I don't have time to review this right now, I will get to it soon, but if we can't find a way to avoid the API break we should stick to semantic versioning and require a 3.0 version. I don't think that's a huge issue; we shouldn't be scared of a major version bump if that's the best way to convey the breakage. |
I agree. I would like to get input from Josh (who is on vacation, so not tagged) or @b-butler about their takes on semver strictness and what they would do in the case of HOOMD. I would be fine with bumping to 3.0. It's also fine to just defer on this PR (or merge into a |
Co-authored-by: Brandon Butler <[email protected]>
…s. Slight errors of O(1e-6) due to floating point precision are expected.
…t usage of box.wrap.
@bdice and @vyasr I would support a major version bump. For the hoomd beta's we are allowing breakages in-between beta versions, but the are not considered official releases of 3.0. I think the more people who follow semantic versioning the better as it leads to less headaches for downstream developers/scripters. I also don't think that a major version bump need be a big ordeal. Many packages have very large major versions, and I think that is fine as long as the changes are in the project's interest. The only caveat is when considering maintenance burden when supporting multiple major versions depending on the level of changes. |
Cool. I think a major bump would be the right way to go. I was also going to propose holding off on merging this into master until we have an idea of what other breaking changes might be useful. Offhand I recall a few other awkward locality APIs and maybe the open RDF normalization work introducing something (I'll need to look back at that eventually). |
@tommy-waltmann what do you think of this PR? Should we just close it or is this still in the future interest of the project in your opinion? |
…d into feature/neighbor-vectors
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Co-authored-by: Brandon Butler <[email protected]>
…d into feature/neighbor-vectors
Does anyone else have any more comments or concerns on this 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.
@tommy-waltmann A couple minor comments. Otherwise LGTM! (I can’t approve since I opened the 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.
LGTM
Description
I am dealing with an unusual case with Voronoi neighbors in a sparse system (only a few particles), where particles can be their own neighbors or share multiple bonds with the same neighbor. For this case, it's insufficient to identify neighbors by their distance. Instead, I need the actual vectors computed by the Voronoi tessellation.
There is an API break worth mentioning here:
NeighborList.from_arrays
can no longer acceptdistances
, and instead requiresvectors
. (The distances are computed internally to match the vectors.) I could not think of a way to avoid this API break.Motivation and Context
In this PR, I re-work the NeighborBond and related classes to store the actual vector for each bond. This vector can be directly re-used in many analysis methods, avoiding the need to perform computing
box.wrap(points[point_index] - query_points[query_point_index])
. I have benchmarks below. This should help improve correctness in a few edge cases like the Voronoi case I mentioned above, and should make it easier if we ever choose to let freud find neighbors beyond the nearest periodic image. I also caught a bug in the tests because of this change.How Has This Been Tested?
Existing tests pass with minor tweaks.
Performance:
Overall I'm not concerned about the performance impact of this PR.
Types of changes
Checklist: