From 80033bd0986582b5dddb326f478588ab19ecfdef Mon Sep 17 00:00:00 2001 From: pattonw Date: Fri, 6 Oct 2023 14:05:58 -0700 Subject: [PATCH] ArraySpec bug fix: allow None roi/voxel size for spatial arrays --- gunpowder/array_spec.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gunpowder/array_spec.py b/gunpowder/array_spec.py index 1400b7d4..9002ae4f 100644 --- a/gunpowder/array_spec.py +++ b/gunpowder/array_spec.py @@ -14,12 +14,12 @@ class ArraySpec(Freezable): roi (:class:`Roi`): The region of interested represented by this array spec. Can be - ``None`` for nonspatial arrays but must otherwise always be set. + ``None`` for nonspatial arrays or to indicate the true value is unknown. voxel_size (:class:`Coordinate`): The size of the spatial axises in world units. Can be ``None`` for - nonspatial arrays but must otherwise always be set. + nonspatial arrays or to indicate the true value is unknown. interpolatable (``bool``): @@ -55,9 +55,6 @@ def __init__( if nonspatial: assert roi is None, "Non-spatial arrays can not have a ROI" assert voxel_size is None, "Non-spatial arrays can not have a voxel size" - else: - assert roi is not None, "Spatial arrays must have a ROI" - assert voxel_size is not None, "Spatial arrays must have a voxel size" self.freeze()