diff --git a/dynd/__init__.py b/dynd/__init__.py index 78b838d3..b765673b 100644 --- a/dynd/__init__.py +++ b/dynd/__init__.py @@ -19,7 +19,3 @@ '__libdynd_version__', '__version__', '__libdynd_git_sha1__', '__git_sha1__', 'annotate', 'test', 'load' ] - -from .nd.registry import propagate_all - -propagate_all() diff --git a/dynd/nd/__init__.py b/dynd/nd/__init__.py index 1cbfb93e..b3a5b34c 100644 --- a/dynd/nd/__init__.py +++ b/dynd/nd/__init__.py @@ -12,7 +12,11 @@ parse_json, squeeze, dtype_of, old_linspace, fields, ndim_of from .callable import callable +from . import functional + +from .registry import propagate_all + +propagate_all() + inf = float('inf') nan = float('nan') - -from . import functional diff --git a/dynd/nd/test/test_callable_type.py b/dynd/nd/test/test_callable_type.py new file mode 100644 index 00000000..aa58a98a --- /dev/null +++ b/dynd/nd/test/test_callable_type.py @@ -0,0 +1,11 @@ +import unittest +# import nd to ensure that the callable type is registered at all. +from dynd import nd, ndt + +class TestCallableType(unittest.TestCase): + + def test_callable(self): + tp = ndt.callable(ndt.void, ndt.int32, ndt.float64, x = ndt.complex128) + + def test_callable_type(self): + tp = ndt.callable(ndt.int32, ndt.float64) diff --git a/dynd/ndt/test/test_type_basics.py b/dynd/nd/test/test_type_basics.py similarity index 86% rename from dynd/ndt/test/test_type_basics.py rename to dynd/nd/test/test_type_basics.py index 5dc90c52..0b077579 100644 --- a/dynd/ndt/test/test_type_basics.py +++ b/dynd/nd/test/test_type_basics.py @@ -1,5 +1,6 @@ import unittest -from dynd import ndt +# import nd to make sure the types are propagated out of the registry. +from dynd import ndt, nd class TestTypeBasics(unittest.TestCase): def test_type_repr(self): diff --git a/dynd/ndt/test/test_dtype.py b/dynd/ndt/test/test_dtype.py index 1ecdb847..29c67343 100644 --- a/dynd/ndt/test/test_dtype.py +++ b/dynd/ndt/test/test_dtype.py @@ -10,9 +10,6 @@ def test_tuple(self): def test_struct(self): tp = ndt.struct(x = ndt.int32, y = ndt.float64) - def test_callable(self): - tp = ndt.callable(ndt.void, ndt.int32, ndt.float64, x = ndt.complex128) - class TestTypeFor(unittest.TestCase): def test_bool(self): self.assertEqual(ndt.bool, ndt.type_for(True)) @@ -182,9 +179,6 @@ def test_fixed_bytes_type(self): def test_cstruct_type(self): self.assertFalse(ndt.type('{x: int32}') == ndt.type('{y: int32}')) - def test_callable_type(self): - tp = ndt.callable(ndt.int32, ndt.float64) - def test_struct_type(self): tp = ndt.make_struct([ndt.int32, ndt.int64], ['x', 'y']) self.assertTrue(tp.field_types, [ndt.int32, ndt.int64])