Skip to content

Commit

Permalink
Minor refactor in reader band query normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill888 committed May 28, 2024
1 parent a16cb7b commit 69982f2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions odc/loader/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ def resolve_dst_fill_value(


def _selection_to_bands(selection: Any, n: int) -> list[int]:
if selection is None:
return list(range(1, n + 1))

if isinstance(selection, list):
return selection

Expand All @@ -139,9 +142,7 @@ def resolve_band_query(
)

if src.band == 0:
if selection:
return _selection_to_bands(selection, n)
return list(range(1, n + 1))
return _selection_to_bands(selection, n)

meta = src.meta
if meta is None:
Expand Down

0 comments on commit 69982f2

Please sign in to comment.