histcmp 0.7.0__py3-none-any.whl → 0.8.1__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 +8 -17
- histcmp/cli.py +73 -13
- histcmp/config.py +1 -2
- {histcmp-0.7.0.dist-info → histcmp-0.8.1.dist-info}/METADATA +3 -3
- {histcmp-0.7.0.dist-info → histcmp-0.8.1.dist-info}/RECORD +7 -7
- {histcmp-0.7.0.dist-info → histcmp-0.8.1.dist-info}/WHEEL +1 -1
- {histcmp-0.7.0.dist-info → histcmp-0.8.1.dist-info}/entry_points.txt +0 -0
histcmp/checks.py
CHANGED
|
@@ -41,23 +41,16 @@ class Status(Enum):
|
|
|
41
41
|
return icons.failure
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
ROOT.gInterpreter.Declare(
|
|
45
|
-
"""
|
|
46
|
-
auto MyChi2Test(const TH1* a, const TH1* b, Option_t* option){
|
|
47
|
-
Double_t chi2 = 0;
|
|
48
|
-
Int_t ndf = 0, igood = 0;
|
|
49
|
-
Double_t* res = 0;
|
|
50
|
-
|
|
51
|
-
Double_t prob = a->Chi2TestX(b,chi2,ndf,igood,option,res);
|
|
52
|
-
|
|
53
|
-
return std::make_tuple(prob, chi2, ndf, igood);
|
|
54
|
-
}
|
|
55
|
-
"""
|
|
56
|
-
)
|
|
57
|
-
|
|
58
44
|
|
|
59
45
|
chi2result = collections.namedtuple("chi2result", ["prob", "chi2", "ndf", "igood"])
|
|
60
46
|
|
|
47
|
+
def chi2TestX(h1, h2, option="UU"):
|
|
48
|
+
root_chi2 = ctypes.c_double(0)
|
|
49
|
+
root_ndf = ctypes.c_int(0)
|
|
50
|
+
root_igood = ctypes.c_int(0)
|
|
51
|
+
res = ctypes.POINTER(ctypes.c_double)()
|
|
52
|
+
root_prob = h1.Chi2TestX(h2, root_chi2, root_ndf, root_igood, option, res)
|
|
53
|
+
return chi2result(root_prob, root_chi2.value, root_ndf.value, root_igood.value)
|
|
61
54
|
|
|
62
55
|
class CompatCheck(ABC):
|
|
63
56
|
def __init__(self, disabled: bool = False, suffix: Optional[str] = None):
|
|
@@ -225,9 +218,7 @@ class Chi2Test(ScoreThresholdCheck):
|
|
|
225
218
|
@functools.cached_property
|
|
226
219
|
def _result_v(self):
|
|
227
220
|
with push_root_level(ROOT.kWarning):
|
|
228
|
-
|
|
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))
|
|
221
|
+
res = chi2TestX(self.item_a, self.item_b, "UUOFUF")
|
|
231
222
|
return res
|
|
232
223
|
|
|
233
224
|
@property
|
histcmp/cli.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from typing import Optional
|
|
2
|
+
from typing import Optional, Annotated
|
|
3
3
|
|
|
4
4
|
import typer
|
|
5
5
|
from rich.panel import Panel
|
|
@@ -24,18 +24,78 @@ app = typer.Typer()
|
|
|
24
24
|
|
|
25
25
|
@app.command()
|
|
26
26
|
def main(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
monitored: Annotated[
|
|
28
|
+
Path,
|
|
29
|
+
typer.Argument(
|
|
30
|
+
exists=True,
|
|
31
|
+
dir_okay=False,
|
|
32
|
+
help="Path to the monitored histogram file"
|
|
33
|
+
)
|
|
34
|
+
],
|
|
35
|
+
reference: Annotated[
|
|
36
|
+
Path,
|
|
37
|
+
typer.Argument(
|
|
38
|
+
exists=True,
|
|
39
|
+
dir_okay=False,
|
|
40
|
+
help="Path to the reference histogram file"
|
|
41
|
+
)
|
|
42
|
+
],
|
|
43
|
+
config_path: Annotated[
|
|
44
|
+
Optional[Path],
|
|
45
|
+
typer.Option(
|
|
46
|
+
"--config", "-c",
|
|
47
|
+
dir_okay=False,
|
|
48
|
+
exists=True,
|
|
49
|
+
help="Path to configuration file"
|
|
50
|
+
)
|
|
51
|
+
] = None,
|
|
52
|
+
output: Annotated[
|
|
53
|
+
Optional[Path],
|
|
54
|
+
typer.Option(
|
|
55
|
+
"-o", "--output",
|
|
56
|
+
dir_okay=False,
|
|
57
|
+
help="Path to output report file"
|
|
58
|
+
)
|
|
59
|
+
] = None,
|
|
60
|
+
plots: Annotated[
|
|
61
|
+
Optional[Path],
|
|
62
|
+
typer.Option(
|
|
63
|
+
"-p", "--plots",
|
|
64
|
+
file_okay=False,
|
|
65
|
+
help="Directory to save comparison plots"
|
|
66
|
+
)
|
|
67
|
+
] = None,
|
|
68
|
+
label_monitored: Annotated[
|
|
69
|
+
str,
|
|
70
|
+
typer.Option(
|
|
71
|
+
help="Label for the monitored dataset in plots and reports"
|
|
72
|
+
)
|
|
73
|
+
] = "monitored",
|
|
74
|
+
label_reference: Annotated[
|
|
75
|
+
str,
|
|
76
|
+
typer.Option(
|
|
77
|
+
help="Label for the reference dataset in plots and reports"
|
|
78
|
+
)
|
|
79
|
+
] = "reference",
|
|
80
|
+
title: Annotated[
|
|
81
|
+
str,
|
|
82
|
+
typer.Option(
|
|
83
|
+
help="Title for the comparison report"
|
|
84
|
+
)
|
|
85
|
+
] = "Histogram comparison",
|
|
86
|
+
_filter: Annotated[
|
|
87
|
+
str,
|
|
88
|
+
typer.Option(
|
|
89
|
+
"-f", "--filter",
|
|
90
|
+
help="Regex filter pattern for histogram selection or path to a file with filters"
|
|
91
|
+
)
|
|
92
|
+
] = ".*",
|
|
93
|
+
format: Annotated[
|
|
94
|
+
str,
|
|
95
|
+
typer.Option(
|
|
96
|
+
help="Output format for plots (pdf, png, etc.)"
|
|
97
|
+
)
|
|
98
|
+
] = "pdf",
|
|
39
99
|
):
|
|
40
100
|
try:
|
|
41
101
|
import ROOT
|
histcmp/config.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: histcmp
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary: Compare histograms
|
|
5
5
|
Author-email: Paul Gessinger <hello@paulgessinger.com>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
8
|
Requires-Dist: hist[plot]>=2.8.0
|
|
9
9
|
Requires-Dist: jinja2>=3.1.4
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
histcmp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
histcmp/checks.py,sha256=
|
|
3
|
-
histcmp/cli.py,sha256=
|
|
2
|
+
histcmp/checks.py,sha256=YImyh_wiXGx8F34Eck3i37TmvhYqt2OaZq8s91460_0,13671
|
|
3
|
+
histcmp/cli.py,sha256=00NS8ko-oS5tpnuKEIFNnlUTL_abLzEEPoLRpp_zEe0,7405
|
|
4
4
|
histcmp/compare.py,sha256=hRGyNAyENqDGYtPZ0Iq8o4uGNW7m_29ovscP8_wxfqI,10662
|
|
5
|
-
histcmp/config.py,sha256=
|
|
5
|
+
histcmp/config.py,sha256=Ml0DkWU_983cdn5k_fXI2J3br1xlmkf2j794R5FlEd0,512
|
|
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
|
|
@@ -20,7 +20,7 @@ histcmp/static/css/bulma/bulma.css.map,sha256=039vv4Mje70ZS33gGww4tRQgCnEKI2C87R
|
|
|
20
20
|
histcmp/static/css/bulma/bulma.min.css,sha256=UDtbUHqpVVfXmdJcQVU_bfDEr9xldf3Dbd0ShD0Uf_Y,206620
|
|
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.
|
|
24
|
-
histcmp-0.
|
|
25
|
-
histcmp-0.
|
|
26
|
-
histcmp-0.
|
|
23
|
+
histcmp-0.8.1.dist-info/METADATA,sha256=wg-cMxbkYDY-0ZnYWCZA8iXzDBalu6cPyctPJi9YqmQ,482
|
|
24
|
+
histcmp-0.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
25
|
+
histcmp-0.8.1.dist-info/entry_points.txt,sha256=FWonuHbW2m7wdqkj2ISHGSGzLD59zo-7P0pBsR8yTTc,44
|
|
26
|
+
histcmp-0.8.1.dist-info/RECORD,,
|
|
File without changes
|