-
Notifications
You must be signed in to change notification settings - Fork 49
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 behavior when data includes np.nan? #1251
Comments
Hi @doronbehar , Generally, freud takes a "garbage in, garbage out" approach, meaning it makes no claims about what will happen when it is given invalid data. This approach is what is generally used throughout the python ecosystem, as python isn't a statically-typed language and therefore provides no type-checking natively. A good rule of thumb is to not give freud invalid data and avoid this situation entirely. Does your use case prevent you from validating the data before using it as an input to freud? |
For sure I can accommodate to your policy using something as simple as Even if you wish to not guarantee any behavior, i.e the policy is garbage in garbage out, that should be written in the docs IMHO. In comparison, Numpy doesn't specify the |
@doronbehar You are certainly welcome to perform a full audit of the entire freud source code and determine the You have found a corner case with the neighbor list where the input is used primarily in a comparison. Neighbor lists use values in two ways: 1) Inserting particles into a spatial data structure and 2) comparing the distance between particles. For the 2nd step, the I have no idea how the I think the solution to this issue is that |
Thanks for kindly explaining this. I understand now your concerns and indeed I would never have imagined how these data structures are probably influenced in such a non-trivial manner by a few I agree that raising an error, and writing a word on that in the docs would be great. |
Description
Document what happens when data includes a
np.nan
.Motivation and Context
So I wanted to use this example from the docs:
Putting a
np.nan
in one of the points, produced a result as expected result:I had to run that little test though to find that out, and it would have been nice if it was mentioned even with an example.
The text was updated successfully, but these errors were encountered: