File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 29
29
from xarray .core .types import T_DuckArray
30
30
from xarray .core .utils import NDArrayMixin
31
31
from xarray .core .variable import as_compatible_data , as_variable
32
- from xarray .namedarray .pycompat import array_type
32
+ from xarray .namedarray .pycompat import array_type , is_chunked_array
33
33
from xarray .tests import (
34
34
assert_allclose ,
35
35
assert_array_equal ,
@@ -2732,9 +2732,17 @@ def __init__(self, array):
2732
2732
def chunks (self ):
2733
2733
return self .shape
2734
2734
2735
+ def __array_function__ (self , * args , ** kwargs ):
2736
+ return NotImplemented
2737
+
2738
+ def __array_ufunc__ (self , * args , ** kwargs ):
2739
+ return NotImplemented
2740
+
2741
+
2735
2742
array = CustomArray (np .arange (3 ))
2736
- orig = Variable (dims = ("x" ), data = array , attrs = {"foo" : "bar" })
2737
- assert isinstance (orig ._data , np .ndarray ) # should not be CustomArray
2743
+ assert is_chunked_array (array )
2744
+ var = Variable (dims = ("x" ), data = array )
2745
+ var .load ()
2738
2746
2739
2747
def test_raise_no_warning_for_nan_in_binary_ops ():
2740
2748
with assert_no_warnings ():
You can’t perform that action at this time.
0 commit comments