From 67f3a9c9ce2bfe85356554addcd9230463575581 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Tue, 27 Aug 2024 09:25:54 -0600 Subject: [PATCH 01/15] Make conditional exhaustive --- icepyx/core/APIformatting.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/icepyx/core/APIformatting.py b/icepyx/core/APIformatting.py index 1c225d2ef..44db61df8 100644 --- a/icepyx/core/APIformatting.py +++ b/icepyx/core/APIformatting.py @@ -36,10 +36,6 @@ def _fmt_temporal(start, end, key): assert isinstance(start, dt.datetime) assert isinstance(end, dt.datetime) - assert key in [ - "time", - "temporal", - ], "An invalid time key was submitted for formatting." if key == "temporal": fmt_timerange = ( @@ -53,6 +49,8 @@ def _fmt_temporal(start, end, key): + "," + end.strftime("%Y-%m-%dT%H:%M:%S") ) + else: + raise RuntimeError("An invalid time key was submitted for formatting.") return {key: fmt_timerange} From f0c0d88d5097625097f18379f5f75508058deea8 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 29 Aug 2024 21:22:16 -0600 Subject: [PATCH 02/15] Annotate some of the Parameters class --- icepyx/core/APIformatting.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/icepyx/core/APIformatting.py b/icepyx/core/APIformatting.py index 44db61df8..6c329732d 100644 --- a/icepyx/core/APIformatting.py +++ b/icepyx/core/APIformatting.py @@ -255,13 +255,15 @@ class Parameters(Generic[T]): on the type of query. Must be one of ['search','download'] """ + partype: T + _reqtype: Literal["search", "download"] | None fmted_keys = _FmtedKeysDescriptor() def __init__( self, partype: T, - values=None, - reqtype=None, + values: dict | None = None, + reqtype: Literal["search", "download"] | None = None, ): assert partype in [ "CMR", @@ -280,7 +282,7 @@ def __init__( self._fmted_keys = values if values is not None else {} @property - def poss_keys(self): + def poss_keys(self) -> dict[str, list[str]]: """ Returns a list of possible input keys for the given parameter object. Possible input keys depend on the parameter type (partype). @@ -340,7 +342,7 @@ def _get_possible_keys(self) -> dict[str, list[str]]: ], } - def _check_valid_keys(self): + def _check_valid_keys(self) -> None: """ Checks that any keys passed in with values are valid keys. """ @@ -356,7 +358,7 @@ def _check_valid_keys(self): ) # DevNote: can check_req_values and check_values be combined? - def check_req_values(self): + def check_req_values(self) -> bool: """ Check that all of the required keys have values, if the key was passed in with the values parameter. @@ -375,7 +377,7 @@ def check_req_values(self): else: return False - def check_values(self): + def check_values(self) -> bool: """ Check that the non-required keys have values, if the key was passed in with the values parameter. From 7c01510c89a867f257d251f0101e6c3fde6226d4 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 29 Aug 2024 21:24:39 -0600 Subject: [PATCH 03/15] Refactor poss_keys method --- icepyx/core/APIformatting.py | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/icepyx/core/APIformatting.py b/icepyx/core/APIformatting.py index 6c329732d..811b103e7 100644 --- a/icepyx/core/APIformatting.py +++ b/icepyx/core/APIformatting.py @@ -288,25 +288,8 @@ def poss_keys(self) -> dict[str, list[str]]: Possible input keys depend on the parameter type (partype). """ - if not hasattr(self, "_poss_keys"): - self._get_possible_keys() - - return self._poss_keys - - # @property - # def wanted_keys(self): - # if not hasattr(_wanted): - # self._wanted = [] - - # return self._wanted - - def _get_possible_keys(self) -> dict[str, list[str]]: - """ - Use the parameter type to get a list of possible parameter keys. - """ - if self.partype == "CMR": - self._poss_keys = { + return { "spatial": ["bounding_box", "polygon"], "optional": [ "temporal", @@ -316,7 +299,7 @@ def _get_possible_keys(self) -> dict[str, list[str]]: ], } elif self.partype == "required": - self._poss_keys = { + return { "search": ["short_name", "version", "page_size"], "download": [ "short_name", @@ -331,7 +314,7 @@ def _get_possible_keys(self) -> dict[str, list[str]]: ], } elif self.partype == "subset": - self._poss_keys = { + return { "spatial": ["bbox", "Boundingshape"], "optional": [ "time", @@ -341,6 +324,15 @@ def _get_possible_keys(self) -> dict[str, list[str]]: "Coverage", ], } + else: + raise RuntimeError("Programmer error!") + + # @property + # def wanted_keys(self): + # if not hasattr(_wanted): + # self._wanted = [] + + # return self._wanted def _check_valid_keys(self) -> None: """ From 2948bea4fc7d8cc3ba29944f337f313b5a10e6f9 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 29 Aug 2024 21:25:53 -0600 Subject: [PATCH 04/15] Ignore some typechecker errors I don't know how to deal with right now --- icepyx/core/APIformatting.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/icepyx/core/APIformatting.py b/icepyx/core/APIformatting.py index 811b103e7..02a64cc97 100644 --- a/icepyx/core/APIformatting.py +++ b/icepyx/core/APIformatting.py @@ -229,7 +229,7 @@ def __get__( Returns the dictionary of formatted keys associated with the parameter object. """ - return instance._fmted_keys + return instance._fmted_keys # pyright: ignore[reportReturnType] # ---------------------------------------------------------------------- @@ -344,7 +344,7 @@ def _check_valid_keys(self) -> None: val_list = list({val for lis in self.poss_keys.values() for val in lis}) - for key in self.fmted_keys: + for key in self.fmted_keys: # pyright: ignore[reportAttributeAccessIssue] assert key in val_list, ( "An invalid key (" + key + ") was passed. Please remove it using `del`" ) @@ -359,11 +359,16 @@ def check_req_values(self) -> bool: assert ( self.partype == "required" ), "You cannot call this function for your parameter type" + + if not self._reqtype: + raise RuntimeError("Programmer error!") + reqkeys = self.poss_keys[self._reqtype] - if all(keys in self.fmted_keys for keys in reqkeys): + if all(keys in self.fmted_keys for keys in reqkeys): # pyright: ignore[reportAttributeAccessIssue] assert all( - self.fmted_keys.get(key, -9999) != -9999 for key in reqkeys + self.fmted_keys.get(key, -9999) != -9999 # pyright: ignore[reportAttributeAccessIssue] + for key in reqkeys ), "One of your formatted parameters is missing a value" return True else: @@ -383,7 +388,8 @@ def check_values(self) -> bool: # not the most robust check, but better than nothing... if any(keys in self._fmted_keys for keys in spatial_keys): assert any( - self.fmted_keys.get(key, -9999) != -9999 for key in spatial_keys + self.fmted_keys.get(key, -9999) != -9999 # pyright: ignore[reportAttributeAccessIssue] + for key in spatial_keys ), "One of your formatted parameters is missing a value" return True else: From 05d5abdc11fde2a05ea67fba20f12c2fc1a2b18f Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 29 Aug 2024 21:26:26 -0600 Subject: [PATCH 05/15] Add some typeguards --- icepyx/core/APIformatting.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/icepyx/core/APIformatting.py b/icepyx/core/APIformatting.py index 02a64cc97..4d29b077e 100644 --- a/icepyx/core/APIformatting.py +++ b/icepyx/core/APIformatting.py @@ -425,6 +425,9 @@ def build_params(self, **kwargs) -> None: self._check_valid_keys() if self.partype == "required": + if not self._reqtype: + raise RuntimeError("Programmer error!") + if self.check_req_values() and kwargs == {}: pass else: @@ -482,6 +485,7 @@ def build_params(self, **kwargs) -> None: if any(keys in self._fmted_keys for keys in spatial_keys): pass else: + k = None if self.partype == "CMR": k = kwargs["extent_type"] elif self.partype == "subset": @@ -490,6 +494,9 @@ def build_params(self, **kwargs) -> None: elif kwargs["extent_type"] == "polygon": k = "Boundingshape" + if not k: + raise RuntimeError("Programmer error!") + self._fmted_keys.update({k: kwargs["spatial_extent"]}) From ef5bdbe5b55f148a5e0716505a04b07d9f6b3887 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 29 Aug 2024 21:27:36 -0600 Subject: [PATCH 06/15] Start typechecking APIformatting module --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 564f53976..fb4907d35 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,6 @@ exclude = [ # DevGoal: Remove all ignores ignore = [ "icepyx/quest/*", - "icepyx/core/APIformatting.py", "icepyx/core/auth.py", "icepyx/core/is2ref.py", "icepyx/core/read.py", From 3da94efb5a1528508ab983b78ce32812aaf3d4d2 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Wed, 4 Sep 2024 19:08:39 -0600 Subject: [PATCH 07/15] Use Python 3.9-compatible annotation style --- icepyx/core/APIformatting.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/icepyx/core/APIformatting.py b/icepyx/core/APIformatting.py index 4d29b077e..6d6c6edc6 100644 --- a/icepyx/core/APIformatting.py +++ b/icepyx/core/APIformatting.py @@ -1,7 +1,7 @@ """Generate and format information for submitting to API (CMR and NSIDC).""" import datetime as dt -from typing import Any, Generic, Literal, TypeVar, Union, overload +from typing import Any, Generic, Literal, Optional, TypeVar, Union, overload from icepyx.core.types import ( CMRParams, @@ -256,14 +256,15 @@ class Parameters(Generic[T]): """ partype: T - _reqtype: Literal["search", "download"] | None + _reqtype: Optional[Literal["search", "download"]] fmted_keys = _FmtedKeysDescriptor() + # _fmted_keys: Union[CMRParams, EGISpecificRequiredParams, EGIParamsSubset] def __init__( self, partype: T, - values: dict | None = None, - reqtype: Literal["search", "download"] | None = None, + values: Optional[dict] = None, + reqtype: Optional[Literal["search", "download"]] = None, ): assert partype in [ "CMR", From 7b57037c39981e577e6968028c6f25e2740c325d Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Mon, 9 Sep 2024 18:31:21 -0600 Subject: [PATCH 08/15] Typecheck the temporal module --- icepyx/core/query.py | 11 +++--- icepyx/core/temporal.py | 78 ++++++++++++++++++++++++++--------------- 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/icepyx/core/query.py b/icepyx/core/query.py index 71df8723e..eefdffeb5 100644 --- a/icepyx/core/query.py +++ b/icepyx/core/query.py @@ -1,3 +1,4 @@ +import datetime as dt import pprint from typing import Optional, Union, cast @@ -126,6 +127,8 @@ class GenQuery: Quest """ + _temporal: tp.Temporal + def __init__( self, spatial_extent=None, @@ -157,7 +160,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. @@ -254,7 +257,7 @@ def spatial_extent(self): return (self._spatial._ext_type, self._spatial._spatial_ext) @property - def dates(self): + def dates(self) -> Union[list[str], list[dt.time]]: """ Return an array showing the date range of the query object. Dates are returned as an array containing the start and end datetime @@ -279,7 +282,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. @@ -303,7 +306,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. diff --git a/icepyx/core/temporal.py b/icepyx/core/temporal.py index c02326fbf..ddd8d62ec 100644 --- a/icepyx/core/temporal.py +++ b/icepyx/core/temporal.py @@ -1,12 +1,13 @@ -import datetime as dt -import warnings - """ Helper functions for validation of dates """ +import datetime as dt +from typing import Union +import warnings + -def convert_string_to_date(date): +def convert_string_to_date(date: str) -> dt.date: """ Converts a string to a datetime object. Throws an error if an invalid format is passed in. @@ -49,7 +50,7 @@ def convert_string_to_date(date): ) -def check_valid_date_range(start, end): +def check_valid_date_range(start: dt.date, end: dt.date) -> None: """ Helper function for checking if a date range is valid. @@ -86,7 +87,10 @@ def check_valid_date_range(start, end): ), "Your date range is invalid; end date MUST be on or after the start date." -def validate_times(start_time, end_time): +def validate_times( + start_time: Union[str, dt.time, None], + end_time: Union[str, dt.time, None], +) -> tuple[dt.time, dt.time]: """ Validates the start and end times passed into __init__ and returns them as datetime.time objects. @@ -141,7 +145,11 @@ def validate_times(start_time, end_time): return start_time, end_time -def validate_date_range_datestr(date_range, start_time=None, end_time=None): +def validate_date_range_datestr( + date_range: list[str], + start_time: Union[str, dt.time, None] = None, + end_time: Union[str, dt.time, None] = None, +) -> tuple[dt.datetime, dt.datetime]: """ Validates a date range provided in the form of a list of strings. @@ -150,12 +158,10 @@ def validate_date_range_datestr(date_range, start_time=None, end_time=None): Parameters ---------- - date_range: list(str) + date_range: A date range provided in the form of a list of strings Strings must be of formats accepted by validate_inputs_temporal.convert_string_to_date(). List must be of length 2. - start_time: string, datetime.time, None - end_time: string, datetime.time, None Returns ------- @@ -185,17 +191,19 @@ def validate_date_range_datestr(date_range, start_time=None, end_time=None): return _start, _end -def validate_date_range_datetime(date_range, start_time=None, end_time=None): +def validate_date_range_datetime( + date_range: list[dt.datetime], + start_time: Union[str, dt.time, None] = None, + end_time: Union[str, dt.time, None] = None, +) -> tuple[dt.datetime, dt.datetime]: """ Validates a date range provided in the form of a list of datetimes. Parameters ---------- - date_range: list(datetime.datetime) + date_range: A date range provided in the form of a list of datetimes. List must be of length 2. - start_time: None, string, datetime.time - end_time: None, string, datetime.time NOTE: If start and/or end times are given, they will be **ignored** in favor of the time from the start/end datetime.datetime objects. @@ -224,7 +232,11 @@ def validate_date_range_datetime(date_range, start_time=None, end_time=None): return date_range[0], date_range[1] -def validate_date_range_date(date_range, start_time=None, end_time=None): +def validate_date_range_date( + date_range: list[dt.date], + start_time: Union[str, dt.time, None] = None, + end_time: Union[str, dt.time, None] = None, +): """ Validates a date range provided in the form of a list of datetime.date objects. @@ -233,11 +245,9 @@ def validate_date_range_date(date_range, start_time=None, end_time=None): Parameters ---------- - date_range: list(str) + date_range: A date range provided in the form of a list of datetime.dates. List must be of length 2. - start_time: string or datetime.time - end_time: string or datetime.time Returns ------- @@ -261,14 +271,18 @@ def validate_date_range_date(date_range, start_time=None, end_time=None): return _start, _end -def validate_date_range_dict(date_range, start_time=None, end_time=None): +def validate_date_range_dict( + date_range: dict[str, dt.datetime], + start_time: Union[str, dt.time, None] = None, + end_time: Union[str, dt.time, None] = None, +) -> tuple[dt.datetime, dt.datetime]: """ Validates a date range provided in the form of a dict with the following keys: Parameters ---------- - date_range: dict(str, datetime.datetime, datetime.date) + date_range: A date range provided in the form of a dict. date_range must contain only the following keys: * `start_date`: start date, type can be of dt.datetime, dt.date, or string @@ -278,8 +292,6 @@ def validate_date_range_dict(date_range, start_time=None, end_time=None): If the values are of type dt.datetime and were created without times, the datetime package defaults of all 0s are used and the start_time/end_time parameters will be ignored! - start_time: string or datetime.time - end_time: string or datetime.time Returns @@ -366,7 +378,15 @@ def validate_date_range_dict(date_range, start_time=None, end_time=None): class Temporal: - def __init__(self, date_range, start_time=None, end_time=None): + _start: dt.datetime + _end: dt.datetime + + def __init__( + self, + date_range: Union[list, dict], + start_time: Union[str, dt.time, None] = None, + end_time: Union[str, dt.time, None] = None, + ): """ Validates input from "date_range" argument (and start/end time arguments, if provided), then creates a Temporal object with validated inputs as properties of the object. @@ -376,7 +396,7 @@ def __init__(self, date_range, start_time=None, end_time=None): Parameters ---------- - date_range : list or dict, as follows + date_range : Date range of interest, provided as start and end dates, inclusive. Accepted input date formats are: * YYYY-MM-DD string @@ -387,13 +407,13 @@ def __init__(self, date_range, start_time=None, end_time=None): Date inputs are accepted as a list or dictionary with `start_date` and `end_date` keys. Currently, a list of specific dates (rather than a range) is not accepted. TODO: allow searches with a list of dates, rather than a range. - start_time : str, datetime.time, default None + start_time : Start time in UTC/Zulu (24 hour clock). Input types are an HH:mm:ss string or datetime.time object where HH = hours, mm = minutes, ss = seconds. If None is given (and a datetime.datetime object is not supplied for `date_range`), a default of 00:00:00 is applied. - end_time : str, datetime.time, default None + end_time : End time in UTC/Zulu (24 hour clock). Input types are an HH:mm:ss string or datetime.time object where HH = hours, mm = minutes, ss = seconds. @@ -444,14 +464,14 @@ def __init__(self, date_range, start_time=None, end_time=None): "Your date range list is the wrong length. It should be of length 2, with start and end dates only." ) - def __str__(self): + def __str__(self) -> str: return "Start date and time: {0}\nEnd date and time: {1}".format( self._start.strftime("%Y-%m-%d %H:%M:%S"), self._end.strftime("%Y-%m-%d %H:%M:%S"), ) @property - def start(self): + def start(self) -> dt.datetime: """ Return the start date and time of the Temporal object as a datetime.datetime object. @@ -465,7 +485,7 @@ def start(self): return self._start @property - def end(self): + def end(self) -> dt.datetime: """ Return the end date and time of the Temporal object as a datetime.datetime object. From 3efb79d8dce9282c4b77c35b0917384b3a32914f Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Wed, 25 Sep 2024 12:53:38 -0600 Subject: [PATCH 09/15] Fix incorrect type annotation Co-authored-by: Jessica Scheick --- icepyx/core/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepyx/core/query.py b/icepyx/core/query.py index eefdffeb5..8ff45ec23 100644 --- a/icepyx/core/query.py +++ b/icepyx/core/query.py @@ -257,7 +257,7 @@ def spatial_extent(self): return (self._spatial._ext_type, self._spatial._spatial_ext) @property - def dates(self) -> Union[list[str], list[dt.time]]: + 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 From 224ca75d6eb2d0f500d49d8ad63ce3dc058940e0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:55:35 +0000 Subject: [PATCH 10/15] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- icepyx/core/query.py | 1 - 1 file changed, 1 deletion(-) diff --git a/icepyx/core/query.py b/icepyx/core/query.py index 8ff45ec23..763ec6c52 100644 --- a/icepyx/core/query.py +++ b/icepyx/core/query.py @@ -1,4 +1,3 @@ -import datetime as dt import pprint from typing import Optional, Union, cast From 7751e26d39c2141ff41884d58b8dc992e7cfa402 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Wed, 25 Sep 2024 17:59:47 -0600 Subject: [PATCH 11/15] Relocate comment --- icepyx/core/temporal.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/icepyx/core/temporal.py b/icepyx/core/temporal.py index ddd8d62ec..3e51b9a53 100644 --- a/icepyx/core/temporal.py +++ b/icepyx/core/temporal.py @@ -1,11 +1,9 @@ -""" -Helper functions for validation of dates -""" - import datetime as dt from typing import Union import warnings +#### Helper functions for validation of dates #### + def convert_string_to_date(date: str) -> dt.date: """ From d037e1140b9274225adff6a30b664b2c80b0cb52 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Wed, 25 Sep 2024 18:08:17 -0600 Subject: [PATCH 12/15] Fixup incorrect annotation --- icepyx/core/temporal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepyx/core/temporal.py b/icepyx/core/temporal.py index 3e51b9a53..d43286398 100644 --- a/icepyx/core/temporal.py +++ b/icepyx/core/temporal.py @@ -270,7 +270,7 @@ def validate_date_range_date( def validate_date_range_dict( - date_range: dict[str, dt.datetime], + date_range: dict[str, dt.date], start_time: Union[str, dt.time, None] = None, end_time: Union[str, dt.time, None] = None, ) -> tuple[dt.datetime, dt.datetime]: From 97a5544f7e059c2bd1869c7d587c11c4281be3f2 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 26 Sep 2024 09:33:42 -0600 Subject: [PATCH 13/15] Fix date_range dict annotation Co-Authored-By: Jessica Scheick --- icepyx/core/temporal.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/icepyx/core/temporal.py b/icepyx/core/temporal.py index d43286398..20caaf2c2 100644 --- a/icepyx/core/temporal.py +++ b/icepyx/core/temporal.py @@ -270,7 +270,7 @@ def validate_date_range_date( def validate_date_range_dict( - date_range: dict[str, dt.date], + date_range: dict[str, Union[str, dt.datetime]], start_time: Union[str, dt.time, None] = None, end_time: Union[str, dt.time, None] = None, ) -> tuple[dt.datetime, dt.datetime]: @@ -303,7 +303,6 @@ def validate_date_range_dict( >>> valid_drange = validate_date_range_dict(drange, "00:00:00", "23:59:59") >>> valid_drange (datetime.datetime(2016, 1, 1, 0, 0), datetime.datetime(2020, 1, 1, 23, 59, 59)) - """ # Try to get keys from date_range dict From b0eb2b97a9269dd1f3d2e908312b1c699c3f9028 Mon Sep 17 00:00:00 2001 From: Matt Fisher Date: Thu, 26 Sep 2024 15:38:42 -0600 Subject: [PATCH 14/15] Fix incorrect type annotation Co-authored-by: Jessica Scheick --- icepyx/core/temporal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepyx/core/temporal.py b/icepyx/core/temporal.py index 20caaf2c2..86b7a56d1 100644 --- a/icepyx/core/temporal.py +++ b/icepyx/core/temporal.py @@ -270,7 +270,7 @@ def validate_date_range_date( def validate_date_range_dict( - date_range: dict[str, Union[str, dt.datetime]], + date_range: dict[str, Union[str, dt.date]], start_time: Union[str, dt.time, None] = None, end_time: Union[str, dt.time, None] = None, ) -> tuple[dt.datetime, dt.datetime]: From af907f37a85f1ad93eb92a3e3e1c535df8b87265 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 27 Sep 2024 15:03:01 +0000 Subject: [PATCH 15/15] GitHub action UML generation auto-update --- .../documentation/classes_dev_uml.svg | 138 +++++++++--------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/doc/source/user_guide/documentation/classes_dev_uml.svg b/doc/source/user_guide/documentation/classes_dev_uml.svg index 5be4ca7af..223dbde8d 100644 --- a/doc/source/user_guide/documentation/classes_dev_uml.svg +++ b/doc/source/user_guide/documentation/classes_dev_uml.svg @@ -4,11 +4,11 @@ - + classes_dev_uml - + icepyx.quest.dataset_scripts.argo.Argo @@ -241,20 +241,20 @@ icepyx.core.query.GenQuery - -GenQuery - -_spatial -_temporal -dates -end_time -spatial -spatial_extent -start_time -temporal - -__init__(spatial_extent, date_range, start_time, end_time) -__str__() + +GenQuery + +_spatial +_temporal +dates +end_time +spatial +spatial_extent +start_time +temporal + +__init__(spatial_extent, date_range, start_time, end_time) +__str__() @@ -415,30 +415,30 @@ icepyx.core.query.Query->icepyx.core.query.GenQuery - - + + icepyx.quest.quest.Quest - -Quest - -datasets : dict - -__init__(spatial_extent, date_range, start_time, end_time, proj) -__str__() -add_argo(params, presRange): None -add_icesat2(product, start_time, end_time, version, cycles, tracks, files): None -download_all(path) -save_all(path) -search_all() + +Quest + +datasets : dict + +__init__(spatial_extent, date_range, start_time, end_time, proj) +__str__() +add_argo(params, presRange): None +add_icesat2(product, start_time, end_time, version, cycles, tracks, files): None +download_all(path) +save_all(path) +search_all() icepyx.quest.quest.Quest->icepyx.core.query.GenQuery - - + + @@ -472,58 +472,58 @@ icepyx.core.spatial.Spatial - -Spatial - -_ext_type : str -_gdf_spat : GeoDataFrame -_geom_file : NoneType -_spatial_ext -_xdateln -extent -extent_as_gdf -extent_file -extent_type - -__init__(spatial_extent) -__str__() -fmt_for_CMR() -fmt_for_EGI() + +Spatial + +_ext_type : str +_gdf_spat : GeoDataFrame +_geom_file : NoneType +_spatial_ext +_xdateln +extent +extent_as_gdf +extent_file +extent_type + +__init__(spatial_extent) +__str__() +fmt_for_CMR() +fmt_for_EGI() icepyx.core.spatial.Spatial->icepyx.core.query.GenQuery - - -_spatial + + +_spatial icepyx.core.spatial.Spatial->icepyx.core.query.GenQuery - - -_spatial + + +_spatial icepyx.core.temporal.Temporal - -Temporal - -_end : datetime -_start : datetime -end -start - -__init__(date_range, start_time, end_time) -__str__() + +Temporal + +_end : datetime +_start : datetime +end +start + +__init__(date_range: Union[list, dict], start_time: Union[str, dt.time, None], end_time: Union[str, dt.time, None]) +__str__(): str icepyx.core.temporal.Temporal->icepyx.core.query.GenQuery - - -_temporal + + +_temporal