diff --git a/bob/bio/base/config/grid/grid.py b/bob/bio/base/config/grid/grid.py new file mode 100644 index 0000000000000000000000000000000000000000..f4c3852de7b0509fb52413706bb6c85962fc2f58 --- /dev/null +++ b/bob/bio/base/config/grid/grid.py @@ -0,0 +1,4 @@ +import bob.bio.base + +# define the queue using all the default parameters +grid = bob.bio.base.grid.Grid() diff --git a/bob/bio/base/test/test_utils.py b/bob/bio/base/test/test_utils.py index a3abdad73c4e3f673890c817525c12ef7b449d14..b8781f902776a3e51d12237f0af06a73032fc590 100644 --- a/bob/bio/base/test/test_utils.py +++ b/bob/bio/base/test/test_utils.py @@ -22,6 +22,22 @@ def test_resources(): assert isinstance (cls, bob.bio.base.algorithm.PCA) +def test_grid(): + # try to load the grid configurations + g = bob.bio.base.load_resource("grid", "grid") + assert not g.is_local() + + g = bob.bio.base.load_resource("local-p4", "grid") + assert g.is_local() + assert g.number_of_parallel_processes == 4 + g = bob.bio.base.load_resource("local-p8", "grid") + assert g.is_local() + assert g.number_of_parallel_processes == 8 + g = bob.bio.base.load_resource("local-p16", "grid") + assert g.is_local() + assert g.number_of_parallel_processes == 16 + + def test_io(): # Test that bob.bio.base.load and save works as expected filename = bob.io.base.test_utils.temporary_filename() @@ -64,13 +80,13 @@ def test_io(): def test_sampling(): # test selection of elements indices = bob.bio.base.selected_indices(100, 10) - assert indices == range(5, 100, 10) + assert indices == list(range(5, 100, 10)) indices = bob.bio.base.selected_indices(100, 300) - assert indices == range(100) + assert indices == list(range(100)) indices = bob.bio.base.selected_indices(100, None) - assert indices == range(100) + assert indices == list(range(100)) array = numpy.arange(100) elements = bob.bio.base.selected_elements(array, 10) diff --git a/setup.py b/setup.py index f0d761575c7308fe296de8fd2af3c39fcc6b7fb6..6b85a5b3ef7dc0e4e13b8ab8dd05c4b28732e9ce 100644 --- a/setup.py +++ b/setup.py @@ -133,7 +133,8 @@ setup( 'bob.bio.grid': [ 'local-p4 = bob.bio.base.config.grid.local:grid', 'local-p8 = bob.bio.base.config.grid.local:grid_p8', - 'local-p16 = bob.bio.base.config.grid.local:grid_p16' + 'local-p16 = bob.bio.base.config.grid.local:grid_p16', + 'grid = bob.bio.base.config.grid.grid:grid' ], },