From b909fa6326d2204a30e38cc39a10fe5559c6357c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:26:56 +0000 Subject: [PATCH 1/7] Build(deps): Bump bids-examples from `ad9db4b` to `4460013` Bumps [bids-examples](https://github.com/bids-standard/bids-examples) from `ad9db4b` to `4460013`. - [Release notes](https://github.com/bids-standard/bids-examples/releases) - [Commits](https://github.com/bids-standard/bids-examples/compare/ad9db4bbae20f76ff9512932940a719b865e3d50...4460013876560adf95ecef44dc59a5883d24a30b) --- updated-dependencies: - dependency-name: bids-examples dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- bids-examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids-examples b/bids-examples index ad9db4bb..44600138 160000 --- a/bids-examples +++ b/bids-examples @@ -1 +1 @@ -Subproject commit ad9db4bbae20f76ff9512932940a719b865e3d50 +Subproject commit 4460013876560adf95ecef44dc59a5883d24a30b From d1e4ba19123b97463138c40f29c9b1abc28e6d35 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Mon, 12 Aug 2024 17:18:00 +0200 Subject: [PATCH 2/7] fix some tests --- .gitignore | 1 + bids/layout/tests/test_path_building.py | 18 +----------------- bids/layout/tests/test_validation.py | 13 ++++++------- 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index 336f5530..0c9fe70f 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ nosetests.xml coverage.xml *,cover .hypothesis/ +cov.xml # Translations *.mo diff --git a/bids/layout/tests/test_path_building.py b/bids/layout/tests/test_path_building.py index 410119bc..07dc1545 100644 --- a/bids/layout/tests/test_path_building.py +++ b/bids/layout/tests/test_path_building.py @@ -135,23 +135,7 @@ def test_path_building_in_raw_scope(dataset, bids_examples): assert path == bf.path @pytest.mark.parametrize("scope", ["raw"]) -@pytest.mark.parametrize( - "dataset", - [ - pytest.param( - "ds000247", - marks=pytest.mark.xfail(strict=True, - reason="meg ds folder" - ), - ), - pytest.param( - "ds000246", - marks=pytest.mark.xfail(strict=True, - reason="meg ds folder" - ), - ), - ], -) +@pytest.mark.parametrize("dataset", ["ds000247", "ds000246"]) def test_path_building_on_examples_with_derivatives_meg_ds_folder(dataset, scope, bids_examples): layout = BIDSLayout(bids_examples / dataset, derivatives=True) files = layout.get(subject=".*", datatype=".*", regex_search = True, scope=scope) diff --git a/bids/layout/tests/test_validation.py b/bids/layout/tests/test_validation.py index 54d32ddb..0e568d54 100644 --- a/bids/layout/tests/test_validation.py +++ b/bids/layout/tests/test_validation.py @@ -112,8 +112,8 @@ def test_is_session_level_true(testvalidator): # checks is_session_level() function false cases -def test_is_session_level_false(testvalidator): - target_list = [ +@pytest.mark.parametrize("item", + [ "/sub-01/ses-ses/sub-01_dwi.bval", # redundant dir /ses-ses/ "/sub-01/01_dwi.bvec", # missed subject suffix "/sub-01/sub_dwi.json", # missed subject id @@ -138,11 +138,10 @@ def test_is_session_level_false(testvalidator): "/sub-01/ses-test/sub-02_ses-test_acq-singleband_run-01_dwi.bval", # wrong sub id in the filename "/sub-01/sub-01_ses-test_acq-singleband_run-01_dwi.bvec", # ses dir missed "/ses-test/sub-01_ses-test_acq-singleband_run-01_dwi.json" # sub id dir missed - ] - - for item in target_list: - result = testvalidator.is_session_level(item) - assert not result + ]) +def test_is_session_level_false(testvalidator, item): + result = testvalidator.is_session_level(item) + assert not result # checks is_subject_level() function true cases From 6b59a634028edeca508fe20677e267feba28ef2d Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 14 Aug 2024 10:18:23 +0200 Subject: [PATCH 3/7] fix expected number of files for .ds MEG datasets --- bids/layout/tests/test_layout_on_examples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bids/layout/tests/test_layout_on_examples.py b/bids/layout/tests/test_layout_on_examples.py index a42c0619..47561e16 100644 --- a/bids/layout/tests/test_layout_on_examples.py +++ b/bids/layout/tests/test_layout_on_examples.py @@ -46,7 +46,7 @@ def test_layout_on_examples_with_derivatives(dataset, nb_files, bids_examples): ("asl005", 10), ("ds001", 134), # with anat and func data ("eeg_cbm", 104), - ("ds000246", 54), # with meg data + ("ds000246", 19), # with meg data (excludes all files in .ds folders) ("genetics_ukbb", 96), # with dwi data ("ieeg_visual_multimodal", 148), # also with fmap data; ignore stimmuli folder ("pet001", 12), From 50f48e4a7ba18abdd2b91a60ee25f32ad6885cd3 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 14 Aug 2024 10:40:47 +0200 Subject: [PATCH 4/7] mark test as xfail --- bids/layout/tests/test_validation.py | 49 +++++++++++++++------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/bids/layout/tests/test_validation.py b/bids/layout/tests/test_validation.py index 0e568d54..5be30ecb 100644 --- a/bids/layout/tests/test_validation.py +++ b/bids/layout/tests/test_validation.py @@ -111,39 +111,44 @@ def test_is_session_level_true(testvalidator): assert result +# checks is_session_level() function false cases +@pytest.mark.parametrize("item", + [ + pytest.param( + "/sub-01/ses-ses/sub-01_dwi.bval", # redundant dir /ses-ses/ + marks=pytest.mark.xfail(strict=True, + reason="meg ds folder" + ), + ), + pytest.param( + "/sub-01/ses-test/sub-01_run-01_dwi.bvec", # missed session in the filename + marks=pytest.mark.xfail(strict=True, + reason="meg ds folder" + ), + ), + pytest.param( + "/sub-01/ses-test/ses-test_run-01_dwi.json", # missed subject in the filename + marks=pytest.mark.xfail(strict=True, + reason="meg ds folder" + ), + ) + ]) +def test_is_session_level_false(testvalidator, item): + result = testvalidator.is_session_level(item) + assert not result + + # checks is_session_level() function false cases @pytest.mark.parametrize("item", [ "/sub-01/ses-ses/sub-01_dwi.bval", # redundant dir /ses-ses/ - "/sub-01/01_dwi.bvec", # missed subject suffix - "/sub-01/sub_dwi.json", # missed subject id - "/sub-01/sub-01_23_run-01_dwi.bval", # wrong _23_ - "/sub-01/sub-01_run-01_dwi.vec", # wrong extension - "/sub-01/sub-01_run-01_dwi.jsn", # wrong extension - "/sub-01/sub-01_acq_dwi.bval", # missed suffix value - "/sub-01/sub-01_acq-23-singleband_dwi.bvec", # redundant -23- - "/sub-01/anat/sub-01_acq-singleband_dwi.json", # redundant /anat/ - "/sub-01/sub-01_recrod-record_acq-singleband_run-01_dwi.bval", # redundant record-record_ - "/sub_01/sub-01_acq-singleband_run-01_dwi.bvec", # wrong /sub_01/ - "/sub-01/sub-01_acq-singleband__run-01_dwi.json", # wrong __ - "/sub-01/ses-test/sub-01_ses_test_dwi.bval", # wrong ses_test - "/sub-01/ses-test/sb-01_ses-test_dwi.bvec", # wrong sb-01 - "/sub-01/ses-test/sub-01_ses-test_dw.json", # wrong modality - "/sub-01/ses-test/sub-01_ses-test_run-01_dwi.val", # wrong extension "/sub-01/ses-test/sub-01_run-01_dwi.bvec", # missed session in the filename "/sub-01/ses-test/ses-test_run-01_dwi.json", # missed subject in the filename - "/sub-01/ses-test/sub-01_ses-test_acq-singleband.bval", # missed modality - "/sub-01/ses-test/sub-01_ses-test_acq-singleband_dwi", # missed extension - "/ses-test/sub-01/sub-01_ses-test_acq-singleband_dwi.json", # wrong dirs order - "/sub-01/ses-test/sub-02_ses-test_acq-singleband_run-01_dwi.bval", # wrong sub id in the filename - "/sub-01/sub-01_ses-test_acq-singleband_run-01_dwi.bvec", # ses dir missed - "/ses-test/sub-01_ses-test_acq-singleband_run-01_dwi.json" # sub id dir missed ]) def test_is_session_level_false(testvalidator, item): result = testvalidator.is_session_level(item) assert not result - # checks is_subject_level() function true cases def test_is_subject_level_true(testvalidator): target_list = [ From 7bca13789338a34ddac00f4d6bb283571808b848 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 14 Aug 2024 10:45:17 +0200 Subject: [PATCH 5/7] fix --- bids/layout/tests/test_validation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bids/layout/tests/test_validation.py b/bids/layout/tests/test_validation.py index 5be30ecb..8185fd42 100644 --- a/bids/layout/tests/test_validation.py +++ b/bids/layout/tests/test_validation.py @@ -117,23 +117,23 @@ def test_is_session_level_true(testvalidator): pytest.param( "/sub-01/ses-ses/sub-01_dwi.bval", # redundant dir /ses-ses/ marks=pytest.mark.xfail(strict=True, - reason="meg ds folder" + reason="invalid" ), ), pytest.param( "/sub-01/ses-test/sub-01_run-01_dwi.bvec", # missed session in the filename marks=pytest.mark.xfail(strict=True, - reason="meg ds folder" + reason="invalid" ), ), pytest.param( "/sub-01/ses-test/ses-test_run-01_dwi.json", # missed subject in the filename marks=pytest.mark.xfail(strict=True, - reason="meg ds folder" + reason="invalid" ), ) ]) -def test_is_session_level_false(testvalidator, item): +def test_is_session_level_false_skip(testvalidator, item): result = testvalidator.is_session_level(item) assert not result From efd766748def5bba122086fa10c71b0cc4a6e337 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 14 Aug 2024 10:51:06 +0200 Subject: [PATCH 6/7] delete redundant test --- bids/layout/tests/test_validation.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/bids/layout/tests/test_validation.py b/bids/layout/tests/test_validation.py index 8185fd42..3940c482 100644 --- a/bids/layout/tests/test_validation.py +++ b/bids/layout/tests/test_validation.py @@ -138,17 +138,6 @@ def test_is_session_level_false_skip(testvalidator, item): assert not result -# checks is_session_level() function false cases -@pytest.mark.parametrize("item", - [ - "/sub-01/ses-ses/sub-01_dwi.bval", # redundant dir /ses-ses/ - "/sub-01/ses-test/sub-01_run-01_dwi.bvec", # missed session in the filename - "/sub-01/ses-test/ses-test_run-01_dwi.json", # missed subject in the filename - ]) -def test_is_session_level_false(testvalidator, item): - result = testvalidator.is_session_level(item) - assert not result - # checks is_subject_level() function true cases def test_is_subject_level_true(testvalidator): target_list = [ From 284ac2bc4384e5226288a2e0a59aabbdd4ed617e Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Thu, 15 Aug 2024 13:47:55 +0200 Subject: [PATCH 7/7] remove tests --- bids/layout/tests/test_validation.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/bids/layout/tests/test_validation.py b/bids/layout/tests/test_validation.py index 3940c482..15599a64 100644 --- a/bids/layout/tests/test_validation.py +++ b/bids/layout/tests/test_validation.py @@ -111,33 +111,6 @@ def test_is_session_level_true(testvalidator): assert result -# checks is_session_level() function false cases -@pytest.mark.parametrize("item", - [ - pytest.param( - "/sub-01/ses-ses/sub-01_dwi.bval", # redundant dir /ses-ses/ - marks=pytest.mark.xfail(strict=True, - reason="invalid" - ), - ), - pytest.param( - "/sub-01/ses-test/sub-01_run-01_dwi.bvec", # missed session in the filename - marks=pytest.mark.xfail(strict=True, - reason="invalid" - ), - ), - pytest.param( - "/sub-01/ses-test/ses-test_run-01_dwi.json", # missed subject in the filename - marks=pytest.mark.xfail(strict=True, - reason="invalid" - ), - ) - ]) -def test_is_session_level_false_skip(testvalidator, item): - result = testvalidator.is_session_level(item) - assert not result - - # checks is_subject_level() function true cases def test_is_subject_level_true(testvalidator): target_list = [