Skip to content

Commit

Permalink
Typecheck spatial module
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 committed Sep 10, 2024
1 parent e805f01 commit e314990
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 72 deletions.
13 changes: 7 additions & 6 deletions icepyx/core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ class GenQuery:
"""

_temporal: tp.Temporal
_spatial: spat.Spatial

def __init__(
self,
spatial_extent=None,
date_range=None,
start_time=None,
end_time=None,
spatial_extent: Union[str, list[float], None] = None,
date_range: Union[list, dict, None] = None,
start_time: Union[str, dt.time, None] = None,
end_time: Union[str, dt.time, None] = None,
**kwargs,
):
# validate & init spatial extent
Expand Down Expand Up @@ -183,7 +184,7 @@ def temporal(self) -> Union[tp.Temporal, list[str]]:
return ["No temporal parameters set"]

@property
def spatial(self):
def spatial(self) -> spat.Spatial:
"""
Return the spatial object, which provides the underlying functionality for validating
and formatting geospatial objects. The spatial object has several properties to enable
Expand All @@ -210,7 +211,7 @@ def spatial(self):
return self._spatial

@property
def spatial_extent(self):
def spatial_extent(self) -> tuple[spat.ExtentType, list[float]]:
"""
Return an array showing the spatial extent of the query object.
Spatial extent is returned as an input type (which depends on how
Expand Down
Loading

0 comments on commit e314990

Please sign in to comment.