Skip to content

Commit

Permalink
allow space and time axes to be singletons
Browse files Browse the repository at this point in the history
  • Loading branch information
FynnBe committed Aug 21, 2024
1 parent f6c3bd7 commit e5d83ba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bioimageio/core/axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,8 @@ def create(cls, axis: AxisLike, maybe_singleton: Optional[bool] = None) -> AxisI

axis_base = super().create(axis)
if maybe_singleton is None:
if isinstance(axis, Axis):
maybe_singleton = axis.type in ("batch", "channel", "index")
elif isinstance(axis, str):
maybe_singleton = axis in ("b", "c", "i")
if isinstance(axis, (Axis, str)):
maybe_singleton = True
else:
if axis.size is None:
maybe_singleton = True
Expand Down

0 comments on commit e5d83ba

Please sign in to comment.