@@ -142,15 +142,18 @@ def from_dict(d: dict[str, Any]) -> Dimension:
142142
143143class SpatialDimension (Dimension ):
144144 @property
145- def extent (self ) -> list [float ]:
145+ def extent (self ) -> list [float ] | None :
146146 """Extent (lower and upper bounds) of the dimension as two-dimensional array.
147147 Open intervals with ``None`` are not allowed."""
148- return get_required (
149- self .properties .get (DIM_EXTENT_PROP ), "cube:dimension" , DIM_EXTENT_PROP
148+ return cast (
149+ list [float ],
150+ get_required (
151+ self .properties .get (DIM_EXTENT_PROP ), "cube:dimension" , DIM_EXTENT_PROP
152+ ),
150153 )
151154
152155 @extent .setter
153- def extent (self , v : list [float ]) -> None :
156+ def extent (self , v : list [float ] | None ) -> None :
154157 self .properties [DIM_EXTENT_PROP ] = v
155158
156159 @property
@@ -228,6 +231,19 @@ def axis(self) -> VerticalSpatialDimensionAxis:
228231 def axis (self , v : VerticalSpatialDimensionAxis ) -> None :
229232 self .properties [DIM_AXIS_PROP ] = v
230233
234+ @property
235+ def extent (self ) -> list [float ] | None :
236+ """Extent (lower and upper bounds) of the dimension as two-dimensional array.
237+ Open intervals with ``None`` are not allowed."""
238+ return self .properties .get (DIM_EXTENT_PROP )
239+
240+ @extent .setter
241+ def extent (self , v : list [float ] | None ) -> None :
242+ if v is None :
243+ self .properties .pop (DIM_EXTENT_PROP , None )
244+ else :
245+ self .properties [DIM_EXTENT_PROP ] = v
246+
231247 @property
232248 def unit (self ) -> str | None :
233249 """The unit of measurement for the data, preferably compliant to `UDUNITS-2
0 commit comments