We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
total_size_mb
IceflowSearchResult
1 parent ebb2d79 commit 608b52bCopy full SHA for 608b52b
src/nsidc/iceflow/data/fetch.py
@@ -61,6 +61,7 @@ def _download_iceflow_search_result(
61
62
logger.info(
63
f"Downloading {len(iceflow_search_result.granules)} granules"
64
+ f" (approx. {iceflow_search_result.total_size_mb} MB)"
65
f" to {output_subdir}."
66
)
67
src/nsidc/iceflow/data/models.py
@@ -247,5 +247,10 @@ class IceflowSearchResult(pydantic.BaseModel):
247
# this that type
248
model_config = pydantic.ConfigDict(arbitrary_types_allowed=True)
249
250
+ @property
251
+ def total_size_mb(self):
252
+ granule_sizes_mb = [granule.size() for granule in self.granules]
253
+ return sum(granule_sizes_mb)
254
+
255
256
IceflowSearchResults = list[IceflowSearchResult]
0 commit comments