Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pybids-core] Loading BIDSLayout with a path to a derivative folder #857

Open
erdalkaraca opened this issue May 13, 2022 · 1 comment
Open

Comments

@erdalkaraca
Copy link

In one of the unit tests, a BIDSLayout is created using a derivative path:

    def test_dataset_missing_generatedby_fails_validation(self):
        dataset_path = Path("ds005_derivs", "format_errs", "no_pipeline_description")
        with pytest.raises(BIDSDerivativesValidationError):
            BIDSLayout(Path(get_test_data_path())/dataset_path)

The expectation is to raise a validation error as the derivative has no GeneratedBy field in its dataset_description file.
How can the implementation be sure that the provided path is a derivative and not the root folder of a dataset?

I am not sure if it is safe to also interpret the path's upper hierarchy. Is this a functionality that you (pybids user community) are expecting and depend on?

@tsalo
Copy link
Member

tsalo commented Oct 27, 2022

Sorry for the massive delay. Any BIDS derivatives dataset should have "DatasetType": "derivatives" in the dataset_description.json, so I would assume that pybids is checking that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants