File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ Deprecations
36
36
37
37
Bug fixes
38
38
~~~~~~~~~
39
-
39
+ - Fix unintended load on datasets when calling :py:meth: `DataArray.plot.scatter ` (:pull: `9818 `).
40
+ By `Jimmy Westling <https://github.com/illviljan >`_.
40
41
41
42
Documentation
42
43
~~~~~~~~~~~~~
Original file line number Diff line number Diff line change @@ -946,7 +946,7 @@ def newplotfunc(
946
946
# Remove any nulls, .where(m, drop=True) doesn't work when m is
947
947
# a dask array, so load the array to memory.
948
948
# It will have to be loaded to memory at some point anyway:
949
- darray = darray .load ()
949
+ darray = darray .compute ()
950
950
darray = darray .where (darray .notnull (), drop = True )
951
951
else :
952
952
size_ = kwargs .pop ("_size" , linewidth )
Original file line number Diff line number Diff line change 33
33
assert_no_warnings ,
34
34
requires_cartopy ,
35
35
requires_cftime ,
36
+ requires_dask ,
36
37
requires_matplotlib ,
37
38
requires_seaborn ,
38
39
)
@@ -3326,6 +3327,24 @@ def test_datarray_scatter(
3326
3327
)
3327
3328
3328
3329
3330
+ @requires_dask
3331
+ @requires_matplotlib
3332
+ @pytest .mark .parametrize (
3333
+ "plotfunc" ,
3334
+ ["scatter" ],
3335
+ )
3336
+ def test_dataarray_not_loading_inplace (plotfunc : str ) -> None :
3337
+ ds = xr .tutorial .scatter_example_dataset ()
3338
+ ds = ds .chunk ()
3339
+
3340
+ with figure_context ():
3341
+ getattr (ds .A .plot , plotfunc )(x = "x" )
3342
+
3343
+ from dask .array import Array
3344
+
3345
+ assert isinstance (ds .A .data , Array )
3346
+
3347
+
3329
3348
@requires_matplotlib
3330
3349
def test_assert_valid_xy () -> None :
3331
3350
ds = xr .tutorial .scatter_example_dataset ()
You can’t perform that action at this time.
0 commit comments