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
Rename ak.choose and ak.cross. #201
Conversation
Something to consider:
It can't just be "pad" because of np.pad. We (with @ianna) added an "r" because the So instead of saying which side should get padded, since this function isn't actually different in that regard, let's use the disambiguator to say what it should be padded with. NumPy's pad fills with zeros; Pandas's pd.Series.str.pad pads with spaces. The fact that Awkward fills with So maybe this or
This would be more in keeping with the use of snake_case and whole words, which was a request from many people (scikit-hep/awkward-0.x#240). @nsmith- suggested |
Ach! But ak.Array must have a method named Okay, so there's a difference between free functions and methods:
If the People ask for it, synonyms To do:
|
Hmm. NumPy has an np.product, but it's going to be deprecated. That could count as an argument against it—a NumPy function of that name technically exists—but it could count as an argument for it—NumPy will never use that name again, for fear of conflicts with old code. |
As long as they're not quite the same, I'll keep their different names. That, at least, will prevent misidentification by accident. The NumPy functions seem to be designed for a single large matrix, while the Awkward functions are reducer-like, which favors computing many small covariances and correlations (e.g. tracking or vertex-finding or something). Also, the ak.covar name has symmetry with ak.var, and they are much closer in behavior than np.cov is to np.var. |
Manually document
|
Final names:
|
This is for #199, and I think I'm going to go with
choose
→combinations
diagonal
→replacement
cross
→product
for the sake of following itertools as much as possible.
cartesian
is also a good word for the last one, but I think if we're going to follow itertools for one, we should follow it for both. (These two functions are related; rules for one should apply to the other.) Besides, someone might not know who Descartes is.