1212except ImportError :
1313 xw = None
1414
15- from larray import LArray , isnan , aslarray , Metadata
16-
1715
1816TESTDATADIR = os .path .dirname (__file__ )
1917
@@ -38,6 +36,7 @@ def inputpath(relpath):
3836
3937def assert_equal_factory (test_func ):
4038 def assert_equal (a , b ):
39+ from larray .core .array import LArray
4140 if isinstance (a , LArray ) and isinstance (b , LArray ) and a .axes != b .axes :
4241 raise AssertionError ("axes differ:\n %s\n \n vs\n \n %s" % (a .axes .info , b .axes .info ))
4342 if not isinstance (a , (np .ndarray , LArray )):
@@ -57,6 +56,7 @@ def assert_equal(a, b):
5756
5857def assert_larray_equal_factory (test_func , convert = True , check_axes = False ):
5958 def assert_equal (a , b ):
59+ from larray .core .array import aslarray
6060 if convert :
6161 a = aslarray (a )
6262 b = aslarray (b )
@@ -88,6 +88,7 @@ def equal(a, b):
8888
8989
9090def nan_equal (a , b ):
91+ from larray .core .ufuncs import isnan
9192 return (a == b ) | (isnan (a ) & isnan (b ))
9293
9394
@@ -121,6 +122,7 @@ def tmp_path(tmpdir, fname):
121122
122123@pytest .fixture
123124def meta ():
125+ from larray .core .metadata import Metadata
124126 title = 'test array'
125127 description = 'Array used for testing'
126128 author = 'John Cleese'
0 commit comments