histcmp 0.6.6__py3-none-any.whl → 0.6.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- histcmp/checks.py +9 -9
- histcmp/plot.py +3 -0
- {histcmp-0.6.6.dist-info → histcmp-0.6.8.dist-info}/METADATA +3 -2
- {histcmp-0.6.6.dist-info → histcmp-0.6.8.dist-info}/RECORD +6 -6
- {histcmp-0.6.6.dist-info → histcmp-0.6.8.dist-info}/WHEEL +1 -1
- {histcmp-0.6.6.dist-info → histcmp-0.6.8.dist-info}/entry_points.txt +0 -0
histcmp/checks.py
CHANGED
|
@@ -8,6 +8,7 @@ import functools
|
|
|
8
8
|
from enum import Enum
|
|
9
9
|
from typing import Tuple, Optional, List
|
|
10
10
|
import warnings
|
|
11
|
+
from cppyy.gbl.std import get
|
|
11
12
|
|
|
12
13
|
import ROOT
|
|
13
14
|
|
|
@@ -49,15 +50,13 @@ auto MyChi2Test(const TH1* a, const TH1* b, Option_t* option){
|
|
|
49
50
|
|
|
50
51
|
Double_t prob = a->Chi2TestX(b,chi2,ndf,igood,option,res);
|
|
51
52
|
|
|
52
|
-
return std::make_tuple(prob, chi2, ndf, igood
|
|
53
|
+
return std::make_tuple(prob, chi2, ndf, igood);
|
|
53
54
|
}
|
|
54
55
|
"""
|
|
55
56
|
)
|
|
56
57
|
|
|
57
58
|
|
|
58
|
-
chi2result = collections.namedtuple(
|
|
59
|
-
"chi2result", ["prob", "chi2", "ndf", "igood", "res"]
|
|
60
|
-
)
|
|
59
|
+
chi2result = collections.namedtuple("chi2result", ["prob", "chi2", "ndf", "igood"])
|
|
61
60
|
|
|
62
61
|
|
|
63
62
|
class CompatCheck(ABC):
|
|
@@ -197,7 +196,7 @@ class KolmogorovTest(ScoreThresholdCheck):
|
|
|
197
196
|
int_a, err_a = integralAndError(self.item_a)
|
|
198
197
|
int_b, err_b = integralAndError(self.item_b)
|
|
199
198
|
values = numpy.array([int_a, int_b, err_a, err_b])
|
|
200
|
-
if numpy.any(numpy.isnan(values)) or numpy.any(values==0):
|
|
199
|
+
if numpy.any(numpy.isnan(values)) or numpy.any(values == 0):
|
|
201
200
|
return False
|
|
202
201
|
|
|
203
202
|
if self.score == 0.0:
|
|
@@ -226,9 +225,10 @@ class Chi2Test(ScoreThresholdCheck):
|
|
|
226
225
|
@functools.cached_property
|
|
227
226
|
def _result_v(self):
|
|
228
227
|
with push_root_level(ROOT.kWarning):
|
|
229
|
-
self._result_v = chi2result(*ROOT.MyChi2Test(self.item_a, self.item_b, "UUOFUF"))
|
|
230
228
|
|
|
231
|
-
|
|
229
|
+
t = ROOT.MyChi2Test(self.item_a, self.item_b, "UUOFUF")
|
|
230
|
+
res = chi2result(get[0](t), get[1](t), get[2](t), get[3](t))
|
|
231
|
+
return res
|
|
232
232
|
|
|
233
233
|
@property
|
|
234
234
|
def score(self) -> float:
|
|
@@ -285,7 +285,7 @@ class IntegralCheck(ScoreThresholdCheck):
|
|
|
285
285
|
|
|
286
286
|
if self.err_a > 0.0:
|
|
287
287
|
self.sigma = numpy.abs(self.int_a - self.int_b) / numpy.sqrt(
|
|
288
|
-
self.err_a
|
|
288
|
+
self.err_a**2 + self.err_b**2
|
|
289
289
|
)
|
|
290
290
|
|
|
291
291
|
@property
|
|
@@ -418,7 +418,7 @@ class ResidualCheck(CompatCheck):
|
|
|
418
418
|
val, _ = get_bin_content_error(self.residual)
|
|
419
419
|
_, err_a = get_bin_content_error(self.item_a)
|
|
420
420
|
_, err_b = get_bin_content_error(self.item_b)
|
|
421
|
-
err = numpy.sqrt(err_a
|
|
421
|
+
err = numpy.sqrt(err_a**2 + err_b**2)
|
|
422
422
|
m = err > 0
|
|
423
423
|
pull = numpy.zeros_like(val)
|
|
424
424
|
pull[m] = numpy.abs(val[m]) / err[m]
|
histcmp/plot.py
CHANGED
|
@@ -42,6 +42,9 @@ def plot_ratio_eff(a, a_err, b, b_err, label_a, label_b):
|
|
|
42
42
|
2, 1, gridspec_kw=dict(height_ratios=[2, 0.5], hspace=0.05)
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
+
a_err = numpy.maximum(0, a_err)
|
|
46
|
+
b_err = numpy.maximum(0, b_err)
|
|
47
|
+
|
|
45
48
|
mplhep.histplot(a.values(), a.axes[0].edges, yerr=a_err, ax=ax, label=label_a)
|
|
46
49
|
mplhep.histplot(b.values(), b.axes[0].edges, yerr=b_err, ax=ax, label=label_b)
|
|
47
50
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: histcmp
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.8
|
|
4
4
|
Summary:
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Paul Gessinger
|
|
@@ -11,6 +11,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
15
|
Requires-Dist: Jinja2 (>=3.0.3,<4.0.0)
|
|
15
16
|
Requires-Dist: PyYAML (>=6.0,<7.0)
|
|
16
17
|
Requires-Dist: click (>=8.1.4,<9.0.0)
|
|
@@ -19,7 +20,7 @@ Requires-Dist: matplotlib (>=3.5.1,<4.0.0)
|
|
|
19
20
|
Requires-Dist: mplhep (>=0.3.26,<0.4.0)
|
|
20
21
|
Requires-Dist: numpy (>=1.25.0,<2.0.0)
|
|
21
22
|
Requires-Dist: pandas (>=2.0.3,<3.0.0)
|
|
22
|
-
Requires-Dist: pydantic (>=
|
|
23
|
+
Requires-Dist: pydantic (>=2.0.0,<3.0.0)
|
|
23
24
|
Requires-Dist: requests (>=2.27.1,<3.0.0)
|
|
24
25
|
Requires-Dist: rich (>=13.4.2,<14.0.0)
|
|
25
26
|
Requires-Dist: scipy (>=1.9.1,<2.0.0)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
histcmp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
histcmp/checks.py,sha256=
|
|
2
|
+
histcmp/checks.py,sha256=YspaeDDgX-Bij5C-OTks9OXeLkiEW0loA1XVyDjQMQo,13702
|
|
3
3
|
histcmp/cli.py,sha256=cxLAfxEYe_6_StPgEU0X8BmplDyGYNf27mBzJNHY-LE,6167
|
|
4
4
|
histcmp/compare.py,sha256=hRGyNAyENqDGYtPZ0Iq8o4uGNW7m_29ovscP8_wxfqI,10662
|
|
5
5
|
histcmp/config.py,sha256=50_qpBba9WdINF7wVH4WnXuPW1b_q02f89b2J9Pu_Zk,500
|
|
6
6
|
histcmp/console.py,sha256=fmJMQEAiRTUD5TkjaDH4ZkInnILl1MPqVPtN_SjCr_M,726
|
|
7
7
|
histcmp/github.py,sha256=RyVGvH11FEzFyEFTZMfqqP-5YQb7OrNQmgQ0nJPIapQ,186
|
|
8
8
|
histcmp/icons.py,sha256=EAPco9IQJgYXfdDW9eoqySnrnqXJAcyrk3XrQowfZMU,117
|
|
9
|
-
histcmp/plot.py,sha256=
|
|
9
|
+
histcmp/plot.py,sha256=13mP_vx-TNPKlTRZWEl8PZpPwtDQ5P-6xfHYkmrcMd4,5030
|
|
10
10
|
histcmp/report.py,sha256=lTPylmzvda0y_NSZlESQiZPFpOgt8-sKiTYlwuQe2eQ,3773
|
|
11
11
|
histcmp/root_helpers.py,sha256=9SWKW9gJIXUGRqJwjSMaLw5fgz_0eRtdqDpyt-z1wRQ,5794
|
|
12
12
|
histcmp/static/alpinejs.intersect.min.js,sha256=VO1OjUyzsV_A9We8L7z25QSZtNou6pqwQdxv60zx0a8,878
|
|
@@ -20,7 +20,7 @@ histcmp/static/css/bulma/bulma.min.css,sha256=UDtbUHqpVVfXmdJcQVU_bfDEr9xldf3Dbd
|
|
|
20
20
|
histcmp/static/css/main.css,sha256=1ZDflGFMNvsFkf4pSDFYFQ-Ob90i4ahOV0YNXvJUL40,315
|
|
21
21
|
histcmp/templates/base.html.j2,sha256=wz23ttE1NG4zshuC-aYp8DUsVUkHjkwRzfJHC3A0rkg,2088
|
|
22
22
|
histcmp/templates/main.html.j2,sha256=1if-d2iZs7pZJz2NJzpSjh4jZY1v_PGz3gvA0i4ccxI,2399
|
|
23
|
-
histcmp-0.6.
|
|
24
|
-
histcmp-0.6.
|
|
25
|
-
histcmp-0.6.
|
|
26
|
-
histcmp-0.6.
|
|
23
|
+
histcmp-0.6.8.dist-info/METADATA,sha256=k5a9mk6PPA_B8WnSP-eqG6JcmnjzhyGPc6X4eBYwa8Q,1015
|
|
24
|
+
histcmp-0.6.8.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
25
|
+
histcmp-0.6.8.dist-info/entry_points.txt,sha256=zK4mzX2VpqdjZVEDpOJJ3Na2ePGRBz-9x5knQx_EaoI,43
|
|
26
|
+
histcmp-0.6.8.dist-info/RECORD,,
|
|
File without changes
|