Skip to content

Commit 6557f01

Browse files
committed
fixing tests as data checker accepts only float and uint16 data
1 parent 11ec6e0 commit 6557f01

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

httomolibgpu/misc/supp_func.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def data_checker(
167167
Parameters
168168
----------
169169
data : xp.ndarray
170-
Input CuPy or Numpy array.
170+
Input CuPy or Numpy array either float32 or uint16 data type.
171171
verbosity : bool
172172
If enabled, then the printing of the warning happens when data contains infs or nans.
173173
method_name : str, optional.

httomolibgpu/prep/alignment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ def distortion_correction_proj_discorpy(
8888
if len(data.shape) == 2:
8989
data = cp.expand_dims(data, axis=0)
9090

91-
data = data_checker(
92-
data, verbosity=True, method_name="distortion_correction_proj_discorpy"
93-
)
91+
# data = data_checker(
92+
# data, verbosity=True, method_name="distortion_correction_proj_discorpy"
93+
# )
9494

9595
# Get info from metadata txt file
9696
xcenter, ycenter, list_fact = _load_metadata_txt(metadata_path)

tests/test_prep/test_alignment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_correct_distortion(
3838

3939
path = os.path.join(distortion_correction_path, image)
4040
im_host = imread(path)
41-
im = cp.asarray(im_host)
41+
im = cp.asarray(im_host.astype(cp.uint16))
4242

4343
shift_xy = [0, 0]
4444
step_xy = [1, 1]
@@ -48,5 +48,5 @@ def test_correct_distortion(
4848

4949
assert_allclose(np.mean(corrected_data), mean_value)
5050
assert np.max(corrected_data) == max_value
51-
assert corrected_data.dtype == np.uint8
51+
assert corrected_data.dtype == cp.uint16
5252
assert corrected_data.flags.c_contiguous

0 commit comments

Comments
 (0)