Skip to content
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

when summing integers, use numpy.sum. #537

Merged
merged 1 commit into from Dec 10, 2018

Conversation

rainwoodman
Copy link
Member

On some occasions when code is ran in e.g. a notebook,
numpy.sum is imported to replace sum, and the behaviro of
numpy.sum([]) is to 0.0 rather than builtin.sum([]) which returns 0.

numpy.sum([]) returning 0.0 causes downstream code expecting integers to fail,
thus copying the code out of nbodykit won't work.

We shall not serve as an poor example in this context.

On some occasions when code is ran in e.g. a notebook,
numpy.sum is imported to replace sum, and the behaviro of
numpy.sum([]) is to 0.0 rather than builtin.sum([]) which returns 0.

numpy.sum([]) returning 0.0 causes downstream code expecting integers to fail,
thus copying the code out of nbodykit won't work.

We shall not serve as an poor example in this context.
@rainwoodman rainwoodman merged commit bf140a0 into bccp:master Dec 10, 2018
@rainwoodman rainwoodman deleted the sum-to-float branch December 10, 2018 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant