Skip to content

Commit

Permalink
Address style issues and fix error.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Oct 4, 2024
1 parent 79d1fb1 commit 544ae7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion sdcflows/cli/tests/test_find_estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@
)
def test_cli_finder_wrapper(tmp_path, capsys, test_id, config, estimator_id):
"""Test the CLI with --dry-run."""
from nibabel.filebasedimages import ImageFileError

import sdcflows.config as sc

# Reload is necessary to clean-up the layout config between parameterized runs
reload(sc)

path = (tmp_path / test_id).absolute()
generate_bids_skeleton(path, config)
with pytest.raises(SystemExit) as wrapped_exit:
with pytest.raises(ImageFileError) as wrapped_exit:
cli_finder_wrapper([str(path), str(tmp_path / "out"), "participant", "--dry-run"])

assert wrapped_exit.value.code == 0
Expand Down
7 changes: 5 additions & 2 deletions sdcflows/utils/wrangler.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,18 @@ def find_estimators(
)

for phase_img in has_phase:
complex_imgs = layout.get(**{**phase_img.get_entities(), **{'part': ['phase', 'mag']}})
complex_imgs = layout.get(
**{**phase_img.get_entities(), **{'part': ['phase', 'mag']}}
)

if complex_imgs[0].path in fm._estimators.sources:
continue

try:
e = fm.FieldmapEstimation(
[
fm.FieldmapFile(img.path, metadata=img.get_metadata()) for img in complex_imgs
fm.FieldmapFile(img.path, metadata=img.get_metadata())
for img in complex_imgs
]
)
except (ValueError, TypeError) as err:
Expand Down

0 comments on commit 544ae7d

Please sign in to comment.