(self)
| 726 | assert kernel_call_count == 0 # should not evaluate dask array |
| 727 | |
| 728 | def test_dataarray_pickle(self): |
| 729 | # Test that pickling/unpickling converts the dask backend |
| 730 | # to numpy in neither the data variable nor the non-index coords |
| 731 | data = build_dask_array("data") |
| 732 | nonindex_coord = build_dask_array("coord") |
| 733 | a1 = DataArray(data, dims=["x"], coords={"y": ("x", nonindex_coord)}) |
| 734 | a1.compute() |
| 735 | assert not a1._in_memory |
| 736 | assert not a1.coords["y"]._in_memory |
| 737 | assert kernel_call_count == 2 |
| 738 | a2 = pickle.loads(pickle.dumps(a1)) |
| 739 | assert kernel_call_count == 2 |
| 740 | assert_identical(a1, a2) |
| 741 | assert not a1._in_memory |
| 742 | assert not a2._in_memory |
| 743 | assert not a1.coords["y"]._in_memory |
| 744 | assert not a2.coords["y"]._in_memory |
| 745 | |
| 746 | def test_dataset_pickle(self): |
| 747 | # Test that pickling/unpickling converts the dask backend |
nothing calls this directly
no test coverage detected