esheldon / esutil

A variety of python utilities focusing on numerical, scientific, and astrophysical computing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stat.histogram runs Binner.calc_stats() twice

erykoff opened this issue · comments

The call to stat.histogram calls Binner.do_hist() which defaults calc_stats=True. Then, histogram() calls Binner.calc_stats() again if necessary (weighted histogram, or more stats).

This leads to a performance degradation (30% slower in one particular use case).

Solution would be to change the call in stat.histogram() to:
b.do_hist(...,calc_stats=False)

Is this still relevant?