Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
D2O
Commits
889b7964
Commit
889b7964
authored
May 26, 2016
by
theos
Browse files
Fixed path for unittests
parent
d7853ed7
Changes
5
Hide whitespace changes
Inline
Side-by-side
setup.py
View file @
889b7964
...
...
@@ -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'
,
'test
s
'
],
packages
=
[
'd2o'
,
'd2o.config'
,
'd2o.mpi_dummy'
,
'test'
],
zip_safe
=
False
,
dependency_links
=
[
...
...
test
s
/hdf5_init_test.hdf5
→
test/hdf5_init_test.hdf5
View file @
889b7964
File moved
test
s
/hdf5_test_folder/hdf5_init_test.hdf5
→
test/hdf5_test_folder/hdf5_init_test.hdf5
View file @
889b7964
File moved
test
s
/hdf5_test_folder/hdf5_init_test_2.hdf5
→
test/hdf5_test_folder/hdf5_init_test_2.hdf5
View file @
889b7964
File moved
test
s
/test_distributed_data_object.py
→
test/test_distributed_data_object.py
View file @
889b7964
...
...
@@ -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
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment