Skip to content

Commit

Permalink
initial test of automatically using cubed
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed May 9, 2023
1 parent 669970c commit 1a22c49
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions cubed_xarray/tests/test_wrapping.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import xarray as xr
from xarray.core.parallelcompat import list_chunkmanagers
import cubed

from cubed_xarray.cubedmanager import CubedManager


class TestDiscoverCubedManager:
def test_list_cubedmanager(self):
chunkmanagers = list_chunkmanagers()
assert 'cubed' in chunkmanagers
assert isinstance(chunkmanagers['cubed'], CubedManager)

def test_chunk(self):
da = xr.DataArray([1, 2], dims='x')
chunked = da.chunk(x=1, chunked_array_type='cubed')
assert isinstance(chunked.data, cubed.Array)
assert chunked.chunksizes == {'x': (1, 1)}

# TODO test cubed is default when dask not installed

# TODO test dask is default over cubed when both installed

0 comments on commit 1a22c49

Please sign in to comment.