Skip to content

Commit 5230048

Browse files
committed
fix: catch potential spaces bug
After this was found to be the culprit in #477
1 parent 990eddd commit 5230048

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nibabies/workflows/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,13 @@ def init_workflow_spaces(execution_spaces: SpatialReferences, age_months: int):
888888
)
889889

890890
LOGGER.debug('Workflow spaces: %s', spaces.get_spaces())
891+
if not any(
892+
space.startswith('MNIInfant') for space in spaces.get_spaces(nonstandard=False, dim=(3,))
893+
):
894+
raise RuntimeError(
895+
'MNIInfant space is required but not found, likely due to a stale templateflow cache. '
896+
'Clear the cache (default: $HOME/.cache/templateflow) and retry.'
897+
)
891898
return spaces
892899

893900

0 commit comments

Comments
 (0)