Skip to content

Commit 2705e74

Browse files
committed
raise ValueError instead of assertion
1 parent 3fbf0c5 commit 2705e74

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bioimageio/core/sample.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,11 @@ def get_member_halo(m: MemberId, round: Callable[[float], int]):
211211
halo: Dict[MemberId, Dict[AxisId, Halo]] = {}
212212
for m in new_axes:
213213
halo[m] = get_member_halo(m, floor)
214-
assert halo[m] == get_member_halo(
215-
m, ceil
216-
), f"failed to unambiguously scale halo {halo[m]} with {new_axes[m]}"
214+
if halo[m] != get_member_halo(m, ceil):
215+
raise ValueError(
216+
f"failed to unambiguously scale halo {halo[m]} with {new_axes[m]}"
217+
+ f" for {m}."
218+
)
217219

218220
inner_slice = {
219221
m: {

0 commit comments

Comments
 (0)