@@ -25,6 +25,7 @@ def inner(
2525
2626 return inner
2727
28+
2829def safe_histogram (
2930 values : np .ndarray ,
3031 bins : Union [int , str , np .ndarray ] = "auto" ,
@@ -40,7 +41,9 @@ def safe_histogram(
4041 except ValueError as exc :
4142 if "Too many bins for data range" in str (exc ):
4243 try :
43- return np .histogram (values , bins = "auto" , weights = weights , density = density )
44+ return np .histogram (
45+ values , bins = "auto" , weights = weights , density = density
46+ )
4447 except ValueError :
4548 finite = values [np .isfinite (values )]
4649 if finite .size == 0 :
@@ -52,9 +55,12 @@ def safe_histogram(
5255 bin_edges = np .array ([vmin - eps , vmin + eps ])
5356 else :
5457 bin_edges = np .array ([vmin , vmax ])
55- return np .histogram (values , bins = bin_edges , weights = weights , density = density )
58+ return np .histogram (
59+ values , bins = bin_edges , weights = weights , density = density
60+ )
5661 raise
5762
63+
5864def histogram_compute (
5965 config : Settings ,
6066 finite_values : np .ndarray ,
@@ -103,7 +109,6 @@ def histogram_compute(
103109 return stats
104110
105111
106-
107112def chi_square (
108113 values : Optional [np .ndarray ] = None , histogram : Optional [np .ndarray ] = None
109114) -> dict :
0 commit comments