histcmp 0.6.6__tar.gz → 0.6.7__tar.gz

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.
Files changed (24) hide show
  1. {histcmp-0.6.6 → histcmp-0.6.7}/PKG-INFO +2 -1
  2. {histcmp-0.6.6 → histcmp-0.6.7}/pyproject.toml +1 -1
  3. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/checks.py +9 -9
  4. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/plot.py +3 -0
  5. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/__init__.py +0 -0
  6. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/cli.py +0 -0
  7. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/compare.py +0 -0
  8. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/config.py +0 -0
  9. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/console.py +0 -0
  10. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/github.py +0 -0
  11. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/icons.py +0 -0
  12. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/report.py +0 -0
  13. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/root_helpers.py +0 -0
  14. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/alpinejs.intersect.min.js +0 -0
  15. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/alpinejs.min.js +0 -0
  16. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/css/bulma/bulma-rtl.css +0 -0
  17. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/css/bulma/bulma-rtl.css.map +0 -0
  18. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/css/bulma/bulma-rtl.min.css +0 -0
  19. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/css/bulma/bulma.css +0 -0
  20. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/css/bulma/bulma.css.map +0 -0
  21. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/css/bulma/bulma.min.css +0 -0
  22. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/static/css/main.css +0 -0
  23. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/templates/base.html.j2 +0 -0
  24. {histcmp-0.6.6 → histcmp-0.6.7}/src/histcmp/templates/main.html.j2 +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: histcmp
3
- Version: 0.6.6
3
+ Version: 0.6.7
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)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "histcmp"
3
- version = "0.6.6"
3
+ version = "0.6.7"
4
4
  description = ""
5
5
  authors = ["Paul Gessinger <hello@paulgessinger.com>"]
6
6
  license = "MIT"
@@ -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, res);
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
- return self._result_v
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 ** 2 + self.err_b ** 2
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 ** 2 + err_b ** 2)
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]
@@ -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
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes