-
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.
Merge pull request #5 from TomNicholas/tests
Initial tests
- Loading branch information
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 |