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 18, 2024
1 parent 7b57037 commit 749fc03
Show file tree
Hide file tree
Showing 3 changed files with 161 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 @@ -128,13 +128,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 @@ -188,7 +189,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 @@ -215,7 +216,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 749fc03

Please sign in to comment.