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

build_path not working because path_patterns not set #213

Closed
Islast opened this issue Jul 24, 2018 · 2 comments
Closed

build_path not working because path_patterns not set #213

Islast opened this issue Jul 24, 2018 · 2 comments
Labels

Comments

@Islast
Copy link
Contributor

Islast commented Jul 24, 2018

It would be ideal for pybids to be able to determine new BIDS compliant paths for new or hypothetical files based on a dictionary of entities. At the moment there is a BIDSLayout method to do this, build_path. However build_path builds paths from the patterns it inherits from BIDSLayout which are currently an empty list, which means that build_path returns nothing.
If i define new path_patterns for a BIDSLayout build_path is able to run as expected.

There seem to be path_patterns defined in the BIDSLayout config files (https://github.com/INCF/pybids/blob/7315f5c41d6cf20c0f4c9d8624e408ed1e1bbf5f/bids/grabbids/config/bids.json lines 82-89). Is there any way to import these when the BIDSLayout is initialised?

@tyarkoni
Copy link
Collaborator

Ah, this is a casualty of the Domain classes introduced in a recent version of grabbit. Before, path_patterns used to be a property of the Layout object, but now each Domain has its own path_patterns. So the build_path method needs to be updated to accept a list of domains as an argument, or to combine all available domains if none is passed. Then it would work fine. I'll try to get to this in the next few days, but feel free to submit a PR to grabbit if you like. I've opened an issue for this here.

@tyarkoni tyarkoni added the bug label Jul 24, 2018
@tyarkoni
Copy link
Collaborator

Took care of this in grabbles/grabbit#79; should be fixed in pybids once I bump grabbit version later today. Thanks for reporting it!

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

No branches or pull requests

2 participants