scikit-hep / histbook

Versatile, high-performance histogram toolkit for Numpy.
BSD 3-Clause "New" or "Revised" License
109 stars 9 forks source link

add support for exporting to TH2 #51

Closed clelange closed 5 years ago

clelange commented 5 years ago

This is a first attempt at addressing #47. I think there are no tests for this in this package, since it's not easy to test with ROOT. I hope I got the axes the right way round. Please let me know what you think. I tried to follow the code style in the class. If this is fine, I can probably extend this further to cover a larger part of the currently unimplemented cases.

I can provide an example notebook.

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 186


Changes Missing Coverage Covered Lines Changed/Added Lines %
histbook/export.py 0 13 0.0%
<!-- Total: 0 13 0.0% -->
Files with Coverage Reduction New Missed Lines %
histbook/book.py 1 74.92%
histbook/util/init.py 1 58.33%
histbook/calc/init.py 2 87.4%
histbook/expr.py 12 83.09%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 185: -0.1%
Covered Lines: 2623
Relevant Lines: 5155

💛 - Coveralls
coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 186


Changes Missing Coverage Covered Lines Changed/Added Lines %
histbook/export.py 0 13 0.0%
<!-- Total: 0 13 0.0% -->
Files with Coverage Reduction New Missed Lines %
histbook/book.py 1 74.92%
histbook/util/init.py 1 58.33%
histbook/calc/init.py 2 87.4%
histbook/expr.py 12 83.09%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 185: -0.1%
Covered Lines: 2623
Relevant Lines: 5155

💛 - Coveralls
coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 186


Changes Missing Coverage Covered Lines Changed/Added Lines %
histbook/export.py 0 13 0.0%
<!-- Total: 0 13 0.0% -->
Files with Coverage Reduction New Missed Lines %
histbook/book.py 1 74.92%
histbook/util/init.py 1 58.33%
histbook/calc/init.py 2 87.4%
histbook/expr.py 12 83.09%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 185: -0.1%
Covered Lines: 2623
Relevant Lines: 5155

💛 - Coveralls
coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 186


Changes Missing Coverage Covered Lines Changed/Added Lines %
histbook/export.py 0 13 0.0%
<!-- Total: 0 13 0.0% -->
Files with Coverage Reduction New Missed Lines %
histbook/book.py 1 74.92%
histbook/util/init.py 1 58.33%
histbook/calc/init.py 2 87.4%
histbook/expr.py 12 83.09%
<!-- Total: 16 -->
Totals Coverage Status
Change from base Build 185: -0.1%
Covered Lines: 2623
Relevant Lines: 5155

💛 - Coveralls
jpivarski commented 5 years ago

This looks good to me and doesn't break any tests (the code coverage going down by 0.1% does not concern me). I'll accept it and increase the version number so that it can go to PyPI.

Thanks!