Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Aug 1, 2024
1 parent f7b4b98 commit aeccfb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions bidsmreye/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def __attrs_post_init__(self) -> None:
)
log.debug(f"Layout in:\n{layout_in.root}")

value = layout_in.get(return_type="id", target="space", datatype="func")
value = layout_in.get(return_type="id", target="subject", datatype="func")
if not value:
raise RuntimeError(

Check warning on line 94 in bidsmreye/configuration.py

View check run for this annotation

Codecov / codecov/patch

bidsmreye/configuration.py#L94

Added line #L94 was not covered by tests
f"Input dataset {layout_in.root} does not have "
f"any data to process with a space entity.\n"
f"any data to process.\n"
"Is your dataset a BIDS derivative dataset?\n"
"Check the FAQ for more information: "
"https://bidsmreye.readthedocs.io/en/latest/FAQ.html"
Expand Down Expand Up @@ -149,7 +149,7 @@ def check_argument(self, attribute: str, layout_in: BIDSLayout) -> Config:
setattr(self, attribute, value)

# run and space can be empty if their entity are not used
if attribute not in ["run"] and not getattr(self, attribute):
if attribute not in ["run", "space"] and not getattr(self, attribute):
raise RuntimeError(f"No {attribute} found in {self.input_dir}")

return self
Expand Down
10 changes: 3 additions & 7 deletions tests/test_quality_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@ def test_quality_control_output():
quality_control_output(cfg)


def test_quality_control_input():
input_dir = Path().resolve().joinpath("tests", "data", "ds000201-der")
output_dir = input_dir.joinpath("derivatives")

rm_dir(output_dir)
def test_quality_control_input(tmp_path):
input_dir = Path("tests") / "data" / "ds000201-der"
output_dir = tmp_path / "derivatives"

cfg = Config(
input_dir,
Expand All @@ -148,8 +146,6 @@ def test_quality_control_input():

quality_control_input(cfg)

rm_dir(output_dir)


def test_perform_quality_control():
create_basic_json()
Expand Down

0 comments on commit aeccfb0

Please sign in to comment.