Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type annotate the temporal module #604

Merged
merged 17 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]:
JessicaS11 marked this conversation as resolved.
Show resolved Hide resolved
"""
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