Skip to content

Commit 7c4699f

Browse files
committed
stricter validation of integer fields
1 parent 019d684 commit 7c4699f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

bioimageio/spec/model/v0_5.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
RootModel,
4444
SerializationInfo,
4545
SerializerFunctionWrapHandler,
46+
StrictInt,
4647
Tag,
4748
ValidationInfo,
4849
WrapSerializer,
@@ -382,7 +383,7 @@ class SizeReference(Node):
382383
axis_id: AxisId
383384
"""axis id of the reference axis"""
384385

385-
offset: int = 0
386+
offset: StrictInt = 0
386387

387388
def get_size(
388389
self,
@@ -2488,8 +2489,8 @@ class LinkedModel(LinkedResourceBase):
24882489

24892490

24902491
class _DataDepSize(NamedTuple):
2491-
min: int
2492-
max: Optional[int]
2492+
min: StrictInt
2493+
max: Optional[StrictInt]
24932494

24942495

24952496
class _AxisSizes(NamedTuple):

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This changelog includes implementation details and my reference the [changes to
1313
#### bioimageio.spec (next release)
1414

1515
- infinity and not-a-number values are no longer allowed (when used in a tensor description under data.range they are replaced with `None`)
16+
- stricter validation of integers; float values no longer allowed for input/output fields `size.offset`, `size.min`, `size.max`
1617

1718
#### bioimageio.spec 0.5.4.3
1819

0 commit comments

Comments
 (0)