Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial tests #5

Merged
merged 1 commit into from
May 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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