diff options
author | Hind-M <hind.montassif@gmail.com> | 2021-10-27 10:01:23 +0200 |
---|---|---|
committer | Hind-M <hind.montassif@gmail.com> | 2021-10-27 10:01:23 +0200 |
commit | 2ffbd4d63afd59b9d1995a7755db087b31f9c998 (patch) | |
tree | 7ed0c78d32adbf62a2631517f91a8d53acbc937e /src/python/test | |
parent | 3a29558decccafe0b07dbf07d66f1410df6c187f (diff) |
Add test to check outputs of the two torus implementations
Diffstat (limited to 'src/python/test')
-rwxr-xr-x | src/python/test/test_datasets_generators.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/test/test_datasets_generators.py b/src/python/test/test_datasets_generators.py index 933a763e..91ec4a65 100755 --- a/src/python/test/test_datasets_generators.py +++ b/src/python/test/test_datasets_generators.py @@ -33,3 +33,7 @@ def _basic_torus(impl): def test_torus(): for torus_impl in [points.torus, points.ctorus]: _basic_torus(torus_impl) + # Check that the two versions (torus and ctorus) generate the same output + assert points.ctorus(n_samples = 64, dim = 3, sample = 'random').all() == points.torus(n_samples = 64, dim = 3, sample = 'random').all() + assert points.ctorus(n_samples = 64, dim = 3, sample = 'grid').all() == points.torus(n_samples = 64, dim = 3, sample = 'grid').all() + assert points.ctorus(n_samples = 10, dim = 3, sample = 'grid').all() == points.torus(n_samples = 10, dim = 3, sample = 'grid').all() |