Skip to content

Commit

Permalink
chore: solving chunk search for omi (#243)
Browse files Browse the repository at this point in the history
fix a problem that was erroring when OMI were subsetted (in the estimation of the dataset size)
  • Loading branch information
uriii3 authored Dec 4, 2024
1 parent aeeb0ea commit 73c0ed8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions copernicusmarine/download_functions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ def get_number_of_chunks_for_coordinate(
values.append(values[-1] + step_value) # type: ignore
elif not values:
return None
elif type(values[0]) is str:
return None

values.sort()
if requested_minimum is None or requested_minimum < values[0]: # type: ignore
Expand Down Expand Up @@ -387,9 +389,7 @@ def get_number_of_chunks_for_coordinate(
index_right_maximum == len(values) - 1
or index_right_maximum == len(values)
or abs(values[index_right_maximum] - requested_maximum) # type: ignore
<= abs(
values[index_right_maximum + 1] - requested_maximum # type: ignore
)
<= abs(values[index_right_maximum + 1] - requested_maximum) # type: ignore
):
chunk_of_requested_maximum = math.floor(
(index_right_maximum) / chunking_length
Expand Down

0 comments on commit 73c0ed8

Please sign in to comment.