boost-histogram icon indicating copy to clipboard operation
boost-histogram copied to clipboard

addable weight view?

Open HDembinski opened this issue 5 years ago • 4 comments

I am not 100 % sure we should really do this, but it would be handy if the view of a histogram with weight storage would allow adding views and in general all the operators that also the histogram itself supports. The record array in numpy does not support addition or other operators, but since we are wrapping it, we could add support for this special record array.

HDembinski avatar Dec 09 '19 16:12 HDembinski

I've thought about this a bit before and was already mildly in favor of it. Especially since you define a limit here; all operations a histogram supports should also be supported by accumulator views.

henryiii avatar Dec 09 '19 16:12 henryiii

I think this would actually make things like #261 (the adding different storages) easier. If we make different weight views addable, we can do the addition in Python instead of in C++, and avoid binding every possible combination of pair of histograms and keep the compile time down.

henryiii avatar Jan 08 '20 15:01 henryiii

Adding weight views is supported as of #368. Still are some missing operators, though.

henryiii avatar Jun 05 '20 21:06 henryiii

So we need to be able to support the basic operators (addition, division, etc) between to views and between a view and a scalar/array (in some cases). These can be implemented in the same way as #368. That will enable performing operations on views and will enable a few other features.

henryiii avatar Jun 05 '20 21:06 henryiii