# Path: hftools/dataset/arrayobj.py
# class hfarray(_hfarray):
#     def __new__(subtype, data, dims=None, dtype=None, copy=True, order=None,
#                 subok=False, ndmin=0, unit=None, outputformat=None, info=None):
#         if hasattr(data, "__hfarray__"):
#             data, dims = data.__hfarray__()
#             if unit is None and len(dims) == 1:
#                 unit = dims[0].unit
#             if outputformat is None and len(dims) == 1:
#                 outputformat = dims[0].outputformat
#         return _hfarray.__new__(subtype, data, dims=dims, dtype=dtype,
#                                 copy=copy, order=order, subok=subok,
#                                 ndmin=ndmin, unit=unit,
#                                 outputformat=outputformat, info=info)
# 
# Path: hftools/testing/common.py
# class TestCase(unittest.TestCase):
#     def assertAllclose(self, a, b, rtol=1e-05, atol=1e-08, msg=None):
#     def assertIsNotInstance(self, obj, cls):
#     def assertIsInstance(self, obj, cls, msg=None):
#     def assertHFToolsWarning(self, funk, *k, **kw):
#     def assertHFToolsDeprecationWarning(self, funk, *k, **kw):
# def get_label():
# def make_load_tests(module):
#     def load_tests(loader, standard_tests, pattern):
# def _random_array(shape):
# def random_array(N, maxsize=6, minsize=1):
# def random_complex_array(N, maxsize=6, minsize=1):
# def random_value_array_from_dims(dims, mean=0, scale=1):
# def random_value_array(N, maxsize, minsize=1):
# def random_complex_value_array(N, maxsize, minsize=1):
# def random_dims(N, maxsize, minsize=1):
# def random_complex_matrix(N, maxsize, minsize=1, Nmatrix=2, Nmatrixj=None):
# def SKIP(self):  # pragma: no cover
# _IDX = 1


import os
import numpy as np
import hftools.utils as utils
import hftools.testing as testing
from hftools.dataset import hfarray
from hftools.testing import TestCase, make_load_tests, expectedFailure


load_tests = make_load_tests(utils)
basepath = os.path.split(__file__)[0]


class Test_random_array(TestCase):
    def test_float_1(self):
        res = testing.random_array(5, 7, 2)
        self.assertEqual(res.ndim, 5)
        self.assertTrue(np.all([x >= 2 and x <= 7 for x in res.shape]))
        self.assertFalse(np.iscomplexobj(res), msg=str(res))
        self.assertIsNotInstance(res, hfarray)


class Test_random_complex_array(TestCase):
    def test_float_1(self):
        res = testing.random_complex_array(5, 7, 2)
        self.assertEqual(res.ndim, 5)
        self.assertTrue(np.all([x >= 2 and x <= 7 for x in res.shape]))
        self.assertTrue(np.iscomplexobj(res))
        self.assertIsNotInstance(res, hfarray)


class Test_random_complex_value_array(TestCase):
    def test_float_1(self):
        res = testing.random_complex_value_array(5, 7, 2)
        self.assertEqual(res.ndim, 5)
        self.assertTrue(np.all([x >= 2 and x <= 7 for x in res.shape]))
        self.assertTrue(np.iscomplexobj(res))

# Path: hftools/dataset/arrayobj.py
# class hfarray(_hfarray):
#     def __new__(subtype, data, dims=None, dtype=None, copy=True, order=None,
#                 subok=False, ndmin=0, unit=None, outputformat=None, info=None):
#         if hasattr(data, "__hfarray__"):
#             data, dims = data.__hfarray__()
#             if unit is None and len(dims) == 1:
#                 unit = dims[0].unit
#             if outputformat is None and len(dims) == 1:
#                 outputformat = dims[0].outputformat
#         return _hfarray.__new__(subtype, data, dims=dims, dtype=dtype,
#                                 copy=copy, order=order, subok=subok,
#                                 ndmin=ndmin, unit=unit,
#                                 outputformat=outputformat, info=info)
# 
# Path: hftools/testing/common.py
# class TestCase(unittest.TestCase):
#     def assertAllclose(self, a, b, rtol=1e-05, atol=1e-08, msg=None):
#     def assertIsNotInstance(self, obj, cls):
#     def assertIsInstance(self, obj, cls, msg=None):
#     def assertHFToolsWarning(self, funk, *k, **kw):
#     def assertHFToolsDeprecationWarning(self, funk, *k, **kw):
# def get_label():
# def make_load_tests(module):
#     def load_tests(loader, standard_tests, pattern):
# def _random_array(shape):
# def random_array(N, maxsize=6, minsize=1):
# def random_complex_array(N, maxsize=6, minsize=1):
# def random_value_array_from_dims(dims, mean=0, scale=1):
# def random_value_array(N, maxsize, minsize=1):
# def random_complex_value_array(N, maxsize, minsize=1):
# def random_dims(N, maxsize, minsize=1):
# def random_complex_matrix(N, maxsize, minsize=1, Nmatrix=2, Nmatrixj=None):
# def SKIP(self):  # pragma: no cover
# _IDX = 1


# Path: hftools/testing/tests/tests_common.py
import os
import numpy as np
import hftools.utils as utils
import hftools.testing as testing
from hftools.dataset import hfarray
from hftools.testing import TestCase, make_load_tests, expectedFailure



load_tests = make_load_tests(utils)
basepath = os.path.split(__file__)[0]


class Test_random_array(TestCase):
    def test_float_1(self):
        res = testing.random_array(5, 7, 2)
        self.assertEqual(res.ndim, 5)
        self.assertTrue(np.all([x >= 2 and x <= 7 for x in res.shape]))
        self.assertFalse(np.iscomplexobj(res), msg=str(res))
        self.assertIsNotInstance(res, hfarray)


class Test_random_complex_array(TestCase):
    def test_float_1(self):
        res = testing.random_complex_array(5, 7, 2)
        self.assertEqual(res.ndim, 5)
        self.assertTrue(np.all([x >= 2 and x <= 7 for x in res.shape]))
        self.assertTrue(np.iscomplexobj(res))
        self.assertIsNotInstance(res, hfarray)


class Test_random_complex_value_array(TestCase):
    def test_float_1(self):
        res = testing.random_complex_value_array(5, 7, 2)
        self.assertEqual(res.ndim, 5)
        self.assertTrue(np.all([x >= 2 and x <= 7 for x in res.shape]))
        self.assertTrue(np.iscomplexobj(res))

        self.assertIsInstance(res, hfarray)