From 70cc63d17d451b127d482dbabb9e02ddcdb3231b Mon Sep 17 00:00:00 2001 From: Dan Raviv Date: Mon, 7 Jul 2025 19:36:08 -0700 Subject: [PATCH] tidy: Update comment np.astype became available in numpy 2.0 The special case is still needed, however, to support older numpy as well as dask. --- xarray/core/duck_array_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xarray/core/duck_array_ops.py b/xarray/core/duck_array_ops.py index 0c7d40113d6..26946d21cff 100644 --- a/xarray/core/duck_array_ops.py +++ b/xarray/core/duck_array_ops.py @@ -247,7 +247,7 @@ def astype(data, dtype, *, xp=None, **kwargs): xp = get_array_namespace(data) if xp == np: - # numpy currently doesn't have a astype: + # numpy<2 and dask don't have astype in their namespace return data.astype(dtype, **kwargs) return xp.astype(data, dtype, **kwargs)