@@ -930,32 +930,13 @@ def __contains__(self, key):
930
930
return key in self ._variables
931
931
932
932
def __len__ (self ):
933
- warnings .warn ('calling len() on an xarray.Dataset will change in '
934
- 'xarray v0.11 to only include data variables, not '
935
- 'coordinates. Call len() on the Dataset.variables '
936
- 'property instead, like ``len(ds.variables)``, to '
937
- 'preserve existing behavior in a forwards compatible '
938
- 'manner.' ,
939
- FutureWarning , stacklevel = 2 )
940
- return len (self ._variables )
933
+ return len (self .data_vars )
941
934
942
935
def __bool__ (self ):
943
- warnings .warn ('casting an xarray.Dataset to a boolean will change in '
944
- 'xarray v0.11 to only include data variables, not '
945
- 'coordinates. Cast the Dataset.variables property '
946
- 'instead to preserve existing behavior in a forwards '
947
- 'compatible manner.' ,
948
- FutureWarning , stacklevel = 2 )
949
- return bool (self ._variables )
936
+ return bool (self .data_vars )
950
937
951
938
def __iter__ (self ):
952
- warnings .warn ('iteration over an xarray.Dataset will change in xarray '
953
- 'v0.11 to only include data variables, not coordinates. '
954
- 'Iterate over the Dataset.variables property instead to '
955
- 'preserve existing behavior in a forwards compatible '
956
- 'manner.' ,
957
- FutureWarning , stacklevel = 2 )
958
- return iter (self ._variables )
939
+ return iter (self .data_vars )
959
940
960
941
def __array__ (self , dtype = None ):
961
942
raise TypeError ('cannot directly convert an xarray.Dataset into a '
0 commit comments