simplification and clean-up

This commit is contained in:
Hans Dembinski
2018-03-02 17:21:28 +01:00
parent 8b11d8cdc5
commit 541ca5eb32
8 changed files with 140 additions and 123 deletions

View File

@@ -334,14 +334,21 @@ std::string histogram_repr(const pyhistogram &h) {
return os.str();
}
double bin_type_value(const pyhistogram::bin_type& b) {
return b.value();
}
double bin_type_variance(const pyhistogram::bin_type& b) {
return b.variance();
}
void register_histogram() {
bp::docstring_options dopt(true, true, false);
bp::class_<pyhistogram::bin_type>(
"bin_type", "Holds value and variance of bin count.", bp::no_init)
.add_property("value", &pyhistogram::bin_type::value)
.add_property("variance", &pyhistogram::bin_type::variance)
;
.add_property("value", bin_type_value)
.add_property("variance", bin_type_variance);
bp::class_<pyhistogram, boost::shared_ptr<pyhistogram>>(
"histogram", "N-dimensional histogram for real-valued data.", bp::no_init)