Skip to content

Commit

Permalink
Tell the typechecker to trust us on the type of reqparams
Browse files Browse the repository at this point in the history
Is this the right way to handle this? Perhaps we need a typeguard.
  • Loading branch information
mfisher87 committed Sep 13, 2024
1 parent 7f60849 commit bb96a5f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
8 changes: 6 additions & 2 deletions icepyx/core/granules.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
import icepyx.core.APIformatting as apifmt
from icepyx.core.auth import EarthdataAuthMixin
import icepyx.core.exceptions
from icepyx.core.types import CMRParams, EGISpecificParamsSearch
from icepyx.core.types import (
CMRParams,
EGISpecificParamsDownload,
EGISpecificParamsSearch,
)
from icepyx.core.urls import DOWNLOAD_BASE_URL, GRANULE_SEARCH_BASE_URL, ORDER_BASE_URL


Expand Down Expand Up @@ -274,7 +278,7 @@ def get_avail(
def place_order(
self,
CMRparams: CMRParams,
reqparams: EGISpecificParamsSearch,
reqparams: EGISpecificParamsDownload,
subsetparams,
verbose,
subset=True,
Expand Down
13 changes: 9 additions & 4 deletions icepyx/core/query.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pprint
from typing import Optional, Union
from typing import Optional, Union, cast

import geopandas as gpd
import matplotlib.pyplot as plt
Expand All @@ -13,7 +13,12 @@
import icepyx.core.is2ref as is2ref
import icepyx.core.spatial as spat
import icepyx.core.temporal as tp
from icepyx.core.types import CMRParams, EGIParamsSubset, EGISpecificRequiredParams
from icepyx.core.types import (
CMRParams,
EGIParamsSubset,
EGISpecificParamsDownload,
EGISpecificRequiredParams,
)
import icepyx.core.validate_inputs as val
from icepyx.core.variables import Variables as Variables
from icepyx.core.visualization import Visualize
Expand Down Expand Up @@ -1039,7 +1044,7 @@ def order_granules(self, verbose=False, subset=True, email=False, **kwargs):
tempCMRparams["readable_granule_name[]"] = gran
self._granules.place_order(
tempCMRparams,
self.reqparams,
cast(EGISpecificParamsDownload, self.reqparams),
self.subsetparams(**kwargs),
verbose,
subset,
Expand All @@ -1049,7 +1054,7 @@ def order_granules(self, verbose=False, subset=True, email=False, **kwargs):
else:
self._granules.place_order(
self.CMRparams,
self.reqparams,
cast(EGISpecificParamsDownload, self.reqparams),
self.subsetparams(**kwargs),
verbose,
subset,
Expand Down

0 comments on commit bb96a5f

Please sign in to comment.