diff options
author | Edoardo Pasca <edo.paskino@gmail.com> | 2019-06-13 15:36:43 +0100 |
---|---|---|
committer | Edoardo Pasca <edo.paskino@gmail.com> | 2019-06-13 15:36:43 +0100 |
commit | 24baca3a99254b0b1de13ffb9a5129de1e36355e (patch) | |
tree | 8235dea9b557ed42a9457425f47d25812dfa8056 /Wrappers | |
parent | e162d5ef4897dcdfdb9b27af050939298409301d (diff) | |
download | framework-24baca3a99254b0b1de13ffb9a5129de1e36355e.tar.gz framework-24baca3a99254b0b1de13ffb9a5129de1e36355e.tar.bz2 framework-24baca3a99254b0b1de13ffb9a5129de1e36355e.tar.xz framework-24baca3a99254b0b1de13ffb9a5129de1e36355e.zip |
fix test import
Diffstat (limited to 'Wrappers')
-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 |