Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
2ccea7bc
Commit
2ccea7bc
authored
9 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Fixed sampling test issue; added generic grid configuration and tests
parent
fa586880
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/bio/base/config/grid/grid.py
+4
-0
4 additions, 0 deletions
bob/bio/base/config/grid/grid.py
bob/bio/base/test/test_utils.py
+19
-3
19 additions, 3 deletions
bob/bio/base/test/test_utils.py
setup.py
+2
-1
2 additions, 1 deletion
setup.py
with
25 additions
and
4 deletions
bob/bio/base/config/grid/grid.py
0 → 100644
+
4
−
0
View file @
2ccea7bc
import
bob.bio.base
# define the queue using all the default parameters
grid
=
bob
.
bio
.
base
.
grid
.
Grid
()
This diff is collapsed.
Click to expand it.
bob/bio/base/test/test_utils.py
+
19
−
3
View file @
2ccea7bc
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
2
−
1
View file @
2ccea7bc
...
...
@@ -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
'
],
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment