# Path: karta/raster/_gdal.py
# ALL = -1
# NUMPY_DTYPE = {"Byte": np.uint8,
#                "UInt16": np.uint16,
#                "Int16": np.int16,
#                "UInt32": np.uint32,
#                "Int32": np.int32,
#                "Float32": np.float32,
#                "Float64": np.float64,
#                "CInt16": np.complex64,
#                "CInt32": np.complex64,
#                "CFloat32": np.complex64,
#                "CFloat64": np.complex64}
# class GdalFileBand(object):
#     def __init__(self, band, dataset):
#     def __del__(self):
#     def getblock(self, yoff, xoff, ny, nx):
#     def setblock(self, yoff, xoff, array):
#     def __iter__(self):
#     def size(self):
#     def dtype(self):
# def SRS_from_WKT(s):
# def numpy_dtype(dt_int):
# def gdal_type(dtype):
# def read(fnm, in_memory, ibands=ALL, bandclass=CompressedBand):
# def srs_from_crs(crs):
# def write(fnm, grid, compress=None, tiled=False, **kw):


import unittest
import os.path
import numpy as np
import karta
from test_helper import TMPDATA
from karta.raster import _gdal


class GdalTests(unittest.TestCase):

    def test_numpy_type_coercion(self):
        self.assertEqual(_gdal.numpy_dtype(2), np.uint16)
        self.assertEqual(_gdal.numpy_dtype(3), np.int16)
        self.assertEqual(_gdal.numpy_dtype(4), np.uint32)
        self.assertEqual(_gdal.numpy_dtype(5), np.int32)

# Path: karta/raster/_gdal.py
# ALL = -1
# NUMPY_DTYPE = {"Byte": np.uint8,
#                "UInt16": np.uint16,
#                "Int16": np.int16,
#                "UInt32": np.uint32,
#                "Int32": np.int32,
#                "Float32": np.float32,
#                "Float64": np.float64,
#                "CInt16": np.complex64,
#                "CInt32": np.complex64,
#                "CFloat32": np.complex64,
#                "CFloat64": np.complex64}
# class GdalFileBand(object):
#     def __init__(self, band, dataset):
#     def __del__(self):
#     def getblock(self, yoff, xoff, ny, nx):
#     def setblock(self, yoff, xoff, array):
#     def __iter__(self):
#     def size(self):
#     def dtype(self):
# def SRS_from_WKT(s):
# def numpy_dtype(dt_int):
# def gdal_type(dtype):
# def read(fnm, in_memory, ibands=ALL, bandclass=CompressedBand):
# def srs_from_crs(crs):
# def write(fnm, grid, compress=None, tiled=False, **kw):


# Path: tests/geotiff_tests.py
import unittest
import os.path
import numpy as np
import karta
from test_helper import TMPDATA
from karta.raster import _gdal



class GdalTests(unittest.TestCase):

    def test_numpy_type_coercion(self):
        self.assertEqual(_gdal.numpy_dtype(2), np.uint16)
        self.assertEqual(_gdal.numpy_dtype(3), np.int16)
        self.assertEqual(_gdal.numpy_dtype(4), np.uint32)
        self.assertEqual(_gdal.numpy_dtype(5), np.int32)

        self.assertEqual(_gdal.numpy_dtype(6), np.float32)