Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Michiel Cottaar
fslpy
Commits
f76c111b
Commit
f76c111b
authored
7 years ago
by
Paul McCarthy
Browse files
Options
Downloads
Patches
Plain Diff
Don't kill memory in CI tests
parent
19c9ce5f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_atlases_query.py
+8
-4
8 additions, 4 deletions
tests/test_atlases_query.py
with
8 additions
and
4 deletions
tests/test_atlases_query.py
+
8
−
4
View file @
f76c111b
...
@@ -15,6 +15,7 @@ import pytest
...
@@ -15,6 +15,7 @@ import pytest
import
fsl.data.atlases
as
fslatlases
import
fsl.data.atlases
as
fslatlases
import
fsl.data.image
as
fslimage
import
fsl.data.image
as
fslimage
import
fsl.utils.transform
as
transform
import
fsl.utils.transform
as
transform
import
fsl.utils.cache
as
cache
from
.
import
(
testdir
,
make_random_mask
)
from
.
import
(
testdir
,
make_random_mask
)
...
@@ -33,15 +34,18 @@ def _repeat(iterator, n):
...
@@ -33,15 +34,18 @@ def _repeat(iterator, n):
yield
elem
yield
elem
# atype: (label|prob)
# We can't cache all atlases, because CI
_atlases
=
{}
# jobs will take up too much memory and
# be killed
_atlases
=
cache
.
Cache
(
3
)
def
_get_atlas
(
atlasID
,
res
,
summary
=
False
):
def
_get_atlas
(
atlasID
,
res
,
summary
=
False
):
atlas
=
_atlases
.
get
((
atlasID
,
res
,
summary
))
atlas
=
_atlases
.
get
((
atlasID
,
res
,
summary
)
,
default
=
None
)
if
atlas
is
None
:
if
atlas
is
None
:
atlas
=
fslatlases
.
loadAtlas
(
atlasID
,
atlas
=
fslatlases
.
loadAtlas
(
atlasID
,
loadSummary
=
summary
,
loadSummary
=
summary
,
resolution
=
res
)
resolution
=
res
)
_atlases
[
atlasID
,
res
,
summary
]
=
atlas
_atlases
.
put
((
atlasID
,
res
,
summary
),
atlas
)
return
atlas
return
atlas
def
_random_atlas
(
atype
,
res
,
summary
=
False
):
def
_random_atlas
(
atype
,
res
,
summary
=
False
):
...
...
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