diff --git a/icepyx/core/granules.py b/icepyx/core/granules.py index 22cc8d140..bcaaef596 100644 --- a/icepyx/core/granules.py +++ b/icepyx/core/granules.py @@ -17,7 +17,7 @@ import icepyx.core.APIformatting as apifmt from icepyx.core.auth import EarthdataAuthMixin import icepyx.core.exceptions -from icepyx.core.types import CMRParams, EGISpecificParams +from icepyx.core.types import CMRParams, EGISpecificRequiredParams from icepyx.core.urls import DOWNLOAD_BASE_URL, GRANULE_SEARCH_BASE_URL, ORDER_BASE_URL @@ -177,7 +177,7 @@ def __init__( def get_avail( self, CMRparams: CMRParams | None, - reqparams: EGISpecificParams | None, + reqparams: EGISpecificRequiredParams | None, cloud=False, ): """ @@ -271,7 +271,7 @@ def get_avail( def place_order( self, CMRparams: CMRParams, - reqparams: EGISpecificParams, + reqparams: EGISpecificRequiredParams, subsetparams, verbose, subset=True, diff --git a/icepyx/core/query.py b/icepyx/core/query.py index ac9231ce5..6fa1ecd77 100644 --- a/icepyx/core/query.py +++ b/icepyx/core/query.py @@ -12,7 +12,7 @@ import icepyx.core.is2ref as is2ref import icepyx.core.spatial as spat import icepyx.core.temporal as tp -from icepyx.core.types import CMRParams, EGISpecificParams, EGISpecificParamsSubset +from icepyx.core.types import CMRParams, EGIParamsSubset, EGISpecificRequiredParams import icepyx.core.validate_inputs as val from icepyx.core.variables import Variables as Variables from icepyx.core.visualization import Visualize @@ -579,7 +579,7 @@ def CMRparams(self) -> CMRParams: return self._CMRparams.fmted_keys @property - def reqparams(self) -> EGISpecificParams: + def reqparams(self) -> EGISpecificRequiredParams: """ Display the required key:value pairs that will be submitted. It generates the dictionary if it does not already exist. @@ -605,7 +605,7 @@ def reqparams(self) -> EGISpecificParams: # @property # DevQuestion: if I make this a property, I get a "dict" object is not callable # when I try to give input kwargs... what approach should I be taking? - def subsetparams(self, **kwargs) -> EGISpecificParamsSubset | dict[Never, Never]: + def subsetparams(self, **kwargs) -> EGIParamsSubset | dict[Never, Never]: """ Display the subsetting key:value pairs that will be submitted. It generates the dictionary if it does not already exist diff --git a/icepyx/core/types.py b/icepyx/core/types.py index b97a410ec..e01e6bd05 100644 --- a/icepyx/core/types.py +++ b/icepyx/core/types.py @@ -73,13 +73,7 @@ class EGISpecificParamsBase(TypedDict): class EGISpecificParamsSearch(EGISpecificParamsBase): - """Parameters for searching through EGI.""" - - -class EGISpecificParamsOrder(EGISpecificParamsBase): - """Parameters for ordering through EGI.""" - - # TODO: Does this type need page_* attributes? + """Parameters for interacting with EGI.""" class EGISpecificParamsDownload(EGISpecificParamsBase): @@ -94,10 +88,24 @@ class EGISpecificParamsDownload(EGISpecificParamsBase): # token, email -class EGISpecificParamsSubset(EGISpecificParamsBase): +class EGIParamsSubsetBase(TypedDict): """Parameters for subsetting with EGI.""" + time: NotRequired[str] + format: NotRequired[str] + projection: NotRequired[str] + projection_parameters: NotRequired[str] + Coverage: NotRequired[str] -EGISpecificParams = ( - EGISpecificParamsSearch | EGISpecificParamsDownload | EGISpecificParamsSubset -) + +class EGIParamsSubsetBbox(EGIParamsSubsetBase): + bbox: str + + +class EGIParamsSubsetBoundingShape(EGIParamsSubsetBase): + Boundingshape: str + + +EGIParamsSubset = EGIParamsSubsetBbox | EGIParamsSubsetBoundingShape + +EGISpecificRequiredParams = EGISpecificParamsSearch | EGISpecificParamsDownload