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
Feature/standardize query args #395
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.
Very helpful! @vyasr you said this PR would be hard to review, but I think it went smoothly. 😄
Some suggestions for edits below:
Codecov Report
@@ Coverage Diff @@
## next #395 +/- ##
==========================================
- Coverage 93.14% 92.79% -0.35%
==========================================
Files 15 15
Lines 3034 3027 -7
Branches 19 19
==========================================
- Hits 2826 2809 -17
- Misses 200 210 +10
Partials 8 8
Continue to review full report at Codecov.
|
I will draft relevant documentation and add to #348 soon. |
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.
Great work! I approve this.
Description
This PR cleans up some of the C++ code for the
QueryArgs
class, introducing more constants into the namespace and improving code consistency. Query argument names have been standardized further, and updated throughout freud. In particular, most references tormax
,nn
,num_neigh
, etc have been removed in favor of the standard namesr_max
andnum_neighbors
. On the Python side, more of theQueryArgs
logic has been standardized by introducing aPairCompute
subclass ofCompute
that encapsulates the standard code that goes at the beginning of everycompute
oraccumulate
call. In the process, I've also defined a standard method for classes to expose a set of default query arguments.Motivation and Context
This PR is necessary to standardize the usage of query arguments (especially default query arguments) throughout freud. It's also consistent with #179 and related changes for improving the API.
How Has This Been Tested?
No new tests have been added yet, they will need to be added once the code is closer to a final state. The main tests we will need to add are ensuring that default query arguments work as expected, and that invalid
QueryArgs
objects are properly rejected.Screenshots (if appropriate):
Types of changes
Checklist: