Skip to content

Commit f4f5d83

Browse files
committed
Extension/datacube - complied with pre-commit hooks
1 parent 6fa0b54 commit f4f5d83

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

pystac/extensions/datacube.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,12 @@ def __init__(self, properties: Dict[str, Any]) -> None:
415415

416416
@property
417417
def dimensions(self) -> List[str]:
418-
"""The dimensions of hte variable. Should refer to keys in the `cube:dimensions` object
418+
"""The dimensions of the variable. Should refer to keys in the `cube:dimensions` object
419419
or be an empty list if the variable has no dimensions"""
420420
return get_required(
421-
self.properties.get(DIM_DIMENSIONS_PROP), "cube:variable", DIM_DIMENSIONS_PROP
421+
self.properties.get(DIM_DIMENSIONS_PROP),
422+
"cube:variable",
423+
DIM_DIMENSIONS_PROP,
422424
)
423425

424426
@dimensions.setter
@@ -443,7 +445,7 @@ def description(self) -> Optional[str]:
443445
return self.properties.get(DIM_DESC_PROP)
444446

445447
@description.setter
446-
def description(self, v: Optional[str]):
448+
def description(self, v: Optional[str]) -> None:
447449
if v is None:
448450
self.properties.pop(DIM_DESC_PROP, None)
449451
else:
@@ -452,16 +454,16 @@ def description(self, v: Optional[str]):
452454
@property
453455
def extent(self) -> List[Union[float, str, None]]:
454456
"""If the variable consists of `ordinal values
455-
<https://en.wikipedia.org/wiki/Level_of_measurement#Ordinal_scale>`, the extent (lower and upper bounds) of the
456-
values as two-dimensional array. Use `None` for open intervals"""
457-
return self.properties.get(DIM_EXTENT_PROP)
457+
<https://en.wikipedia.org/wiki/Level_of_measurement#Ordinal_scale>`, the extent
458+
(lower and upper bounds) of the values as two-dimensional array. Use `None` for
459+
open intervals"""
460+
return get_required(
461+
self.properties.get(DIM_EXTENT_PROP), "cube:variable", DIM_EXTENT_PROP
462+
)
458463

459464
@extent.setter
460-
def extent(self, v: Optional[List[Union[float, str, None]]]):
461-
if v is None:
462-
self.properties.pop(DIM_EXTENT_PROP)
463-
else:
464-
self.properties[DIM_EXTENT_PROP] = v
465+
def extent(self, v: List[Union[float, str, None]]) -> None:
466+
self.properties[DIM_EXTENT_PROP] = v
465467

466468
@property
467469
def values(self) -> Optional[List[Union[float, str]]]:
@@ -470,7 +472,7 @@ def values(self) -> Optional[List[Union[float, str]]]:
470472
return self.properties.get(DIM_VALUES_PROP)
471473

472474
@values.setter
473-
def values(self, v: Optional[List[Union[float, str]]]):
475+
def values(self, v: Optional[List[Union[float, str]]]) -> None:
474476
if v is None:
475477
self.properties.pop(DIM_VALUES_PROP)
476478
else:
@@ -483,7 +485,7 @@ def unit(self) -> Optional[str]:
483485
return self.properties.get(DIM_UNIT_PROP)
484486

485487
@unit.setter
486-
def unit(self, v: Optional[str]):
488+
def unit(self, v: Optional[str]) -> None:
487489
if v is None:
488490
self.properties.pop(DIM_UNIT_PROP)
489491
else:

0 commit comments

Comments
 (0)