Skip to content

Commit 363ff6e

Browse files
committed
improve how batch kwargs are constructed
1 parent cbd74ad commit 363ff6e

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

eogrow/pipelines/download_batch.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,10 @@ def _create_and_save_batch_grid(self) -> None:
282282
bbox_buffer=self.config.grid.bbox_buffer,
283283
)
284284

285-
if self.config.grid.image_size is not None:
286-
width, height = self.config.grid.image_size
287-
batch_columns = {"width": width, "height": height}
288-
else:
289-
batch_columns = {"resolution": self.config.grid.resolution}
290-
291-
grid = {crs: gdf.assign(**batch_columns) for crs, gdf in grid.items()}
285+
width, height = self.config.grid.image_size or (None, None)
286+
batch_kwargs = {"width": width, "height": height, "resolution": self.config.grid.resolution}
287+
batch_kwargs = {k: v for k, v in batch_kwargs.items() if v is not None}
288+
grid = {crs: gdf.assign(**batch_kwargs) for crs, gdf in grid.items()}
292289

293290
grid_folder = self.storage.get_folder(self.area_manager.config.grid_folder_key)
294291
grid_path = fs.path.join(grid_folder, self.area_manager.config.grid_filename)

0 commit comments

Comments
 (0)