diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-06-13 15:48:12 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-06-13 15:48:12 +0100 |
commit | aaaeb0a2fbb12a6de15663ca2bbb64b7c4a8d140 (patch) | |
tree | 885b1a1bc7b998970a7c3a0f9f897a9d46a767d6 | |
parent | 8573fb599ff506a9ebf3f2d5d07deb9b5c671609 (diff) | |
parent | 24baca3a99254b0b1de13ffb9a5129de1e36355e (diff) | |
download | framework-aaaeb0a2fbb12a6de15663ca2bbb64b7c4a8d140.tar.gz framework-aaaeb0a2fbb12a6de15663ca2bbb64b7c4a8d140.tar.bz2 framework-aaaeb0a2fbb12a6de15663ca2bbb64b7c4a8d140.tar.xz framework-aaaeb0a2fbb12a6de15663ca2bbb64b7c4a8d140.zip |
Merge remote branch 'update_fix_test'
-rwxr-xr-x | Wrappers/Python/test/test_DataContainer.py | 28 | ||||
-rwxr-xr-x | Wrappers/Python/test/test_run_test.py | 1 |
2 files changed, 16 insertions, 13 deletions
diff --git a/Wrappers/Python/test/test_DataContainer.py b/Wrappers/Python/test/test_DataContainer.py index 7234167..16f7b86 100755 --- a/Wrappers/Python/test/test_DataContainer.py +++ b/Wrappers/Python/test/test_DataContainer.py @@ -201,21 +201,25 @@ class TestDataContainer(unittest.TestCase): self.assertNumpyArrayEqual(out.as_array(), ds2.as_array()) ds0 = ds - steps.append(timer()) - ds0.add(2, out=out) - steps.append(timer()) - print("ds0.add(2,out=out)", dt(steps), 3, ds0.as_array()[0][0][0]) - self.assertEqual(3., out.as_array()[0][0][0]) + dt1 = 0 + dt2 = 0 + for i in range(10): + steps.append(timer()) + ds0.add(2, out=out) + steps.append(timer()) + print("ds0.add(2,out=out)", dt(steps), 3, ds0.as_array()[0][0][0]) + self.assertEqual(3., out.as_array()[0][0][0]) - dt1 = dt(steps) - steps.append(timer()) - ds3 = ds0.add(2) - steps.append(timer()) - print("ds3 = ds0.add(2)", dt(steps), 5, ds3.as_array()[0][0][0]) - dt2 = dt(steps) - self.assertLess(dt1, dt2) + dt1 += dt(steps)/10 + steps.append(timer()) + ds3 = ds0.add(2) + steps.append(timer()) + print("ds3 = ds0.add(2)", dt(steps), 5, ds3.as_array()[0][0][0]) + dt2 += dt(steps)/10 self.assertNumpyArrayEqual(out.as_array(), ds3.as_array()) + self.assertLess(dt1, dt2) + def binary_subtract(self): print("Test binary subtract") diff --git a/Wrappers/Python/test/test_run_test.py b/Wrappers/Python/test/test_run_test.py index a0db9cb..81ee738 100755 --- a/Wrappers/Python/test/test_run_test.py +++ b/Wrappers/Python/test/test_run_test.py @@ -12,7 +12,6 @@ from ccpi.optimisation.functions import Norm2Sq from ccpi.optimisation.functions import ZeroFunction # from ccpi.optimisation.funcs import Norm1 from ccpi.optimisation.functions import L1Norm -from ccpi.optimisation.funcs import Norm2 from ccpi.optimisation.operators import LinearOperatorMatrix from ccpi.optimisation.operators import Identity |