Skip to content

Commit

Permalink
Return plain floats instead of numpy floats
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Dec 11, 2024
1 parent c96a0cc commit a502407
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions iohub/ngff/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ def get_effective_scale(
if transform.type == "scale":
full_scale *= np.array(transform.scale)

return list(full_scale)
return [float(x) for x in full_scale]

def get_effective_translation(
self,
Expand All @@ -1087,7 +1087,7 @@ def get_effective_translation(
if transform.type == "translation":
full_translation += np.array(transform.translation)

return list(full_translation)
return [float(x) for x in full_translation]

def set_transform(
self,
Expand Down
16 changes: 8 additions & 8 deletions tests/ngff/test_ngff.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,16 +512,16 @@ def test_set_transform_image(ch_shape_dtype, arr_name):
),
]
target_scales = [
(1.0, 1.0, 1.0, 1.0, 1.0),
(1.0, 2.0, 3.0, 4.0, 5.0),
(1.0, 1.0, 1.0, 1.0, 1.0),
(4.0, 4.0, 4.0, 4.0, 4.0),
[1.0, 1.0, 1.0, 1.0, 1.0],
[1.0, 2.0, 3.0, 4.0, 5.0],
[1.0, 1.0, 1.0, 1.0, 1.0],
[4.0, 4.0, 4.0, 4.0, 4.0],
]
target_translations = [
(0.0, 0.0, 0.0, 0.0, 0.0),
(0.0, 0.0, 0.0, 0.0, 0.0),
(1.0, 2.0, 3.0, 4.0, 5.0),
(2.0, 2.0, 2.0, 2.0, 2.0),
[0.0, 0.0, 0.0, 0.0, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0],
[1.0, 2.0, 3.0, 4.0, 5.0],
[2.0, 2.0, 2.0, 2.0, 2.0],
]


Expand Down

0 comments on commit a502407

Please sign in to comment.