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

Use rebin package to do binning #21

Open
adler-j opened this issue Dec 14, 2017 · 4 comments
Open

Use rebin package to do binning #21

adler-j opened this issue Dec 14, 2017 · 4 comments

Comments

@adler-j
Copy link
Member

adler-j commented Dec 14, 2017

https://pypi.python.org/pypi/rebin/1.0.1

Very nice interface

@kohr-h
Copy link
Member

kohr-h commented Dec 15, 2017

Why an extra package? The function is trivial to extend to multiple factors, arbitrary dimension and custom reductions. And the rebin implementation is not faster.

@adler-j
Copy link
Member Author

adler-j commented Dec 16, 2017

Well the function is non-trivial to extend to non-integer reductions for example.

Overall we don't want to teach people to write their own code. Use a library if there is one.

@kohr-h
Copy link
Member

kohr-h commented Dec 16, 2017

Well the function is non-trivial to extend to non-integer reductions for example.

Which is not supported by rebin either.

Overall we don't want to teach people to write their own code. Use a library if there is one.

Agree in general, but if the code consists of two lines, then I prefer that over a package that has to be installed. I also find it kind of instructive to see how do do summing over blocks efficiently in Numpy. With an external package, it's all magic.

@adler-j
Copy link
Member Author

adler-j commented Dec 16, 2017

Which is not supported by rebin either.

Seems you're right

Agree in general, but if the code consists of two lines, then I prefer that over a package that has to be installed. I also find it kind of instructive to see how do do summing over blocks efficiently in Numpy. With an external package, it's all magic.

Well to 98% of the people who need a tutorial, that line is also magic. At least from rebin.rebin they can figure out what it is supposed to do or google the docs. If we're keeping it I'd at least suggest adding a link to e.g. this SO answer:

https://stackoverflow.com/questions/4624112/grouping-2d-numpy-array-in-average/4624923#4624923

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

No branches or pull requests

2 participants