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

[DOCS] .reset() doesn't clear growing axis

Open andrzejnovak opened this issue 3 years ago • 7 comments

Unsure if intended behaviour

andrzejnovak avatar May 01 '21 13:05 andrzejnovak

.reset() empties all the bins. It doesn't remove items from a growing axis (guessing that's what you mean?). Rather wishing we called it .clear() now. :)

henryiii avatar May 01 '21 14:05 henryiii

I see, so it is intended. I was trying to make a copy of a histogram (while trying to make a sum on categorical axes) to assign new bins.

I suppose it's unusual and if some groupby gets implemented unnecessary, but I'm not sure, if it's a completely illegitimate use

andrzejnovak avatar May 01 '21 14:05 andrzejnovak

This is clearly documented as "set counters to 0", so I think it's safe to close?

henryiii avatar May 18 '21 21:05 henryiii

(The name comes from Boost.Histogram, otherwise I'd suggest renaming it to .clear())

henryiii avatar May 18 '21 21:05 henryiii

Sorry, could you point to where it's documented? I couldn't find it with a cursory search.

andrzejnovak avatar May 18 '21 21:05 andrzejnovak

https://github.com/scikit-hep/boost-histogram#cheatsheet and https://boost-histogram.readthedocs.io/en/latest/usage/histogram.html#operations

henryiii avatar May 18 '21 21:05 henryiii

Can this be closed or is there an action that should still be taken?

henryiii avatar Aug 19 '21 02:08 henryiii

I don't think that .clear would be any more obvious than .reset. Important is the documentation, not the name.

HDembinski avatar Aug 16 '22 11:08 HDembinski