Skip to content

Commit

Permalink
type checking (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyCMWF authored Jan 29, 2025
1 parent fc991a3 commit 5377945
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cads_adaptors/tools/area_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ def get_dim_slices(
da_coord = ds[dim_key]

ascending = bool(da_coord[0] < da_coord[1]) # True = ascending, False = descending
coord_del = (da_coord[1] - da_coord[0]).values
coord_del = (da_coord[1] - da_coord[0]).item()
if ascending:
coord_range = [
np.round(da_coord[0].values - coord_del / 2.0, precision),
np.round(da_coord[-1].values + coord_del / 2.0, precision),
np.round(da_coord[0].item() - coord_del / 2.0, precision),
np.round(da_coord[-1].item() + coord_del / 2.0, precision),
]
else:
coord_range = [
np.round(da_coord[-1].values + coord_del / 2.0, precision),
np.round(da_coord[0].values - coord_del / 2.0, precision),
np.round(da_coord[-1].item() + coord_del / 2.0, precision),
np.round(da_coord[0].item() - coord_del / 2.0, precision),
]

if (
Expand Down

0 comments on commit 5377945

Please sign in to comment.