Skip to content

Commit 191dfd7

Browse files
davidwilbytom-andersson
authored andcommitted
add comment explaining types
1 parent 2234cc2 commit 191dfd7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

deepsensor/data/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def compute_xarray_data_resolution(ds: Union[xr.DataArray, xr.Dataset]) -> float
9191
"""
9292
x1_res = np.abs(np.mean(np.diff(ds["x1"])))
9393
x2_res = np.abs(np.mean(np.diff(ds["x2"])))
94+
95+
# ensure float type, since numpy 2, np.mean returns a numpy float32
9496
data_resolution = float(np.min([x1_res, x2_res]))
9597
return data_resolution
9698

0 commit comments

Comments
 (0)