-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial test of automatically using cubed
- Loading branch information
1 parent
669970c
commit 1a22c49
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |