Skip to content

Commit 341ef20

Browse files
committed
removes the default zeros check from the data_checker
1 parent b6cc33f commit 341ef20

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

httomolibgpu/misc/supp_func.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def data_checker(
162162
) -> bool:
163163
"""
164164
Function that performs the variety of checks on input data, in some cases also correct the data and prints warnings.
165-
Currently it checks for: the presence of infs and nans in data; the number of zero elements.
165+
Currently it checks for: the presence of infs and nans in data.
166166
167167
Parameters
168168
----------
@@ -181,11 +181,12 @@ def data_checker(
181181

182182
data = _naninfs_check(data, verbosity=verbosity, method_name=method_name)
183183

184-
_zeros_check(
185-
data,
186-
verbosity=verbosity,
187-
percentage_threshold=50,
188-
method_name=method_name,
189-
)
184+
# ! The number of zero elements check is currently switched off as it requires sorting or AtomicAdd, which makes it inefficient on GPUs. !
185+
# _zeros_check(
186+
# data,
187+
# verbosity=verbosity,
188+
# percentage_threshold=50,
189+
# method_name=method_name,
190+
# )
190191

191192
return data

tests/test_misc/test_supp_func.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def test_zeros_check3_numpy():
157157
assert warning_zeros == False
158158

159159

160-
def test_data_checker_numpy():
160+
def test_data_checker_infsnans_numpy():
161161
_data_input = np.ones(shape=(10, 10, 10)).astype(np.float32)
162162
_data_input[1, 1, 1] = -np.inf
163163
_data_input[1, 1, 2] = np.inf
@@ -181,7 +181,7 @@ def test_data_checker_numpy():
181181
assert _data_output.shape == (10, 10, 10)
182182

183183

184-
def test_data_checker():
184+
def test_data_infsnans_checker():
185185
_data_input = cp.ones(shape=(10, 10, 10)).astype(cp.float32) * 100.0
186186
_data_input[1, 1, 1] = -cp.inf
187187
_data_input[1, 1, 2] = cp.inf

0 commit comments

Comments
 (0)