Skip to content

Commit 6f548e5

Browse files
committed
flip conditional and remove cast
1 parent 7d720d2 commit 6f548e5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

eogrow/pipelines/download_batch.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sqlite3
77
import time
88
from functools import wraps
9-
from typing import Any, Callable, List, Literal, Optional, TypeVar, cast
9+
from typing import Any, Callable, List, Literal, Optional, TypeVar
1010

1111
import fs
1212
import pandas as pd
@@ -282,11 +282,11 @@ def _create_and_save_batch_grid(self) -> None:
282282
bbox_buffer=self.config.grid.bbox_buffer,
283283
)
284284

285-
if self.config.grid.resolution is not None:
286-
batch_columns = {"resolution": self.config.grid.resolution}
287-
else:
288-
width, height = cast(tuple[int, int], self.config.grid.image_size)
285+
if self.config.grid.image_size is not None:
286+
width, height = self.config.grid.image_size
289287
batch_columns = {"width": width, "height": height}
288+
else:
289+
batch_columns = {"resolution": self.config.grid.resolution}
290290

291291
grid = {crs: gdf.assign(**batch_columns) for crs, gdf in grid.items()}
292292

0 commit comments

Comments
 (0)