Skip to content
Snippets Groups Projects
Commit 1be2685f authored by Reimar H Leike's avatar Reimar H Leike
Browse files

some tweaks to make test deterministic

parent 520e69e7
No related branches found
No related tags found
No related merge requests found
...@@ -39,18 +39,13 @@ class Consistency_Tests(unittest.TestCase): ...@@ -39,18 +39,13 @@ class Consistency_Tests(unittest.TestCase):
+ _pow_spaces, + _pow_spaces,
[np.float64, np.complex128])) [np.float64, np.complex128]))
def testDOFDistributor(self, sp, dtype): def testDOFDistributor(self, sp, dtype):
#TODO: Test for DomainTuple
if sp.size < 4: if sp.size < 4:
return return
N_tries = 10 dofdex = np.arange(sp.size).reshape(sp.shape)%3
for i in range(N_tries): dofdex = ift.Field.from_global_data(sp, dofdex)
try: op = ift.DOFDistributor(dofdex)
dofdex = np.random.choice(np.arange(3), size=sp.shape) ift.extra.consistency_check(op, dtype, dtype)
dofdex = ift.Field.from_global_data(sp, dofdex)
op = ift.DOFDistributor(dofdex)
ift.extra.consistency_check(op, dtype, dtype)
return
except ValueError:
pass
@expand(product(_h_spaces, [np.float64, np.complex128])) @expand(product(_h_spaces, [np.float64, np.complex128]))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment