Commit 889b7964 authored by theos's avatar theos

Fixed path for unittests

parent d7853ed7
......@@ -22,7 +22,7 @@ setup(
license = "BSD",
keywords = "parallelization, numerics, MPI",
url = "https://gitlab.mpcdf.mpg.de/ift/D2O",
packages=['d2o', 'd2o.config', 'd2o.mpi_dummy', 'tests'],
packages=['d2o', 'd2o.config', 'd2o.mpi_dummy', 'test'],
zip_safe=False,
dependency_links = [
......
......@@ -13,7 +13,6 @@ import numpy as np
import warnings
import tempfile
import d2o
from d2o import distributed_data_object,\
STRATEGIES
......@@ -81,11 +80,8 @@ comparison_operators = ['__ne__', '__lt__', '__le__', '__eq__', '__ge__',
###############################################################################
hdf5_test_paths = [ # ('hdf5_init_test.hdf5', None),
('hdf5_init_test.hdf5', os.path.join(os.path.dirname(d2o.__file__),
'test/hdf5_init_test.hdf5')),
('hdf5_init_test.hdf5',
os.path.join(os.path.dirname(d2o.__file__),
'test//hdf5_test_folder/hdf5_init_test.hdf5'))]
('hdf5_init_test.hdf5', 'test/hdf5_init_test.hdf5'),
('hdf5_init_test.hdf5', 'test/hdf5_test_folder/hdf5_init_test.hdf5')]
###############################################################################
......@@ -136,10 +132,11 @@ def generate_data(global_shape, dtype, distribution_strategy,
if strictly_positive:
a = abs(a)
a *= (rank + 1)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
a = a.reshape(local_shape).astype(dtype)
a *= (rank + 1)
obj = distributed_data_object(
local_data=a, distribution_strategy=distribution_strategy)
a_list = comm.allgather(a)
......@@ -1728,7 +1725,7 @@ if FOUND['h5py'] == True:
path=path,
overwriteQ=False))
obj *= 3
obj = obj*3
obj.save(alias=alias, path=path)
p = distributed_data_object(alias=alias,
path=path)
......@@ -1746,7 +1743,8 @@ class Test_axis(unittest.TestCase):
@parameterized.expand(
itertools.product(['sum', 'prod', 'mean', 'var', 'std', 'all', 'any',
'min', 'amin', 'nanmin', 'argmin', 'argmin_nonflat',
'max', 'amax', 'nanmax', 'argmax', 'argmax_nonflat'],
'max', 'amax', 'nanmax', 'argmax',
'argmax_nonflat'],
all_datatypes[1:],
[(0,), (4, 0, 3)],
all_distribution_strategies,
......@@ -1784,6 +1782,9 @@ class Test_axis(unittest.TestCase):
testcase_func_name=custom_name_func)
def test_axis_with_operations(self, function, dtype, global_shape,
distribution_strategy, axis):
import d2o
print d2o.config.dependency_injector.registry
(a, obj) = generate_data(global_shape, dtype,
distribution_strategy,
strictly_positive=True)
......@@ -1865,6 +1866,7 @@ class Test_axis(unittest.TestCase):
(a, obj) = generate_data(global_shape, dtype,
distribution_strategy,
strictly_positive=True)
print (a, obj)
if 0 in global_shape:
assert_raises(ValueError,
lambda: getattr(obj, function_pair[0])(axis=axis))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment