# Path: cloudvolume/dask.py
# def to_cloudvolume(arr,
#                    cloudpath,
#                    resolution=(1, 1, 1),
#                    voxel_offset=(0, 0, 0),
#                    layer_type=None,
#                    encoding='raw',
#                    max_mip=0,
#                    compute=True,
#                    return_stored=False,
#                    **kwargs):
# def _create_cloudvolume(cloudpath, info, **kwargs):
# def from_cloudvolume(cloudpath, chunks=None, name=None, **kwargs):


import os
import pytest
import sys
import numpy as np
from cloudvolume import dask as dasklib



@pytest.mark.skipif(sys.version_info[0] < 3, reason="Python 2 not supported.")
def test_roundtrip_3d():
  da = pytest.importorskip('dask.array')
  du = pytest.importorskip('dask.utils')
  a = da.random.randint(100, size=(3, 3, 3), chunks=1)
  with du.tmpdir() as d:
    d = 'file://' + d

# Path: cloudvolume/dask.py
# def to_cloudvolume(arr,
#                    cloudpath,
#                    resolution=(1, 1, 1),
#                    voxel_offset=(0, 0, 0),
#                    layer_type=None,
#                    encoding='raw',
#                    max_mip=0,
#                    compute=True,
#                    return_stored=False,
#                    **kwargs):
# def _create_cloudvolume(cloudpath, info, **kwargs):
# def from_cloudvolume(cloudpath, chunks=None, name=None, **kwargs):


# Path: test/test_dask.py
import os
import pytest
import sys
import numpy as np
from cloudvolume import dask as dasklib




@pytest.mark.skipif(sys.version_info[0] < 3, reason="Python 2 not supported.")
def test_roundtrip_3d():
  da = pytest.importorskip('dask.array')
  du = pytest.importorskip('dask.utils')
  a = da.random.randint(100, size=(3, 3, 3), chunks=1)
  with du.tmpdir() as d:
    d = 'file://' + d

    dasklib.to_cloudvolume(a, d)