Skip to content

Commit

Permalink
Type annotate the temporal module (#604)
Browse files Browse the repository at this point in the history
Co-authored-by: Jessica Scheick <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jessica Scheick <[email protected]>
  • Loading branch information
4 people authored Sep 27, 2024
1 parent b7e07bf commit 628ad8f
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 103 deletions.
138 changes: 69 additions & 69 deletions doc/source/user_guide/documentation/classes_dev_uml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions icepyx/core/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ class GenQuery:
Quest
"""

_temporal: tp.Temporal

def __init__(
self,
spatial_extent=None,
Expand Down Expand Up @@ -157,7 +159,7 @@ def __str__(self):
# Properties

@property
def temporal(self):
def temporal(self) -> Union[tp.Temporal, list[str]]:
"""
Return the Temporal object containing date/time range information for the query object.
Expand Down Expand Up @@ -254,7 +256,7 @@ def spatial_extent(self):
return (self._spatial._ext_type, self._spatial._spatial_ext)

@property
def dates(self):
def dates(self) -> list[str]:
"""
Return an array showing the date range of the query object.
Dates are returned as an array containing the start and end datetime
Expand All @@ -279,7 +281,7 @@ def dates(self):
] # could also use self._start.date()

@property
def start_time(self):
def start_time(self) -> Union[list[str], str]:
"""
Return the start time specified for the start date.
Expand All @@ -303,7 +305,7 @@ def start_time(self):
return self._temporal._start.strftime("%H:%M:%S")

@property
def end_time(self):
def end_time(self) -> Union[list[str], str]:
"""
Return the end time specified for the end date.
Expand Down
Loading

0 comments on commit 628ad8f

Please sign in to comment.