-
Notifications
You must be signed in to change notification settings - Fork 124
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
Would it be possible/desirable to be able to pickle BIDSLayout objects? #435
Comments
cc @satra to know whether this makes sense from the Nipype perspective |
In 0.9 (still a WIP), the |
That sounds great, making BIDSLayout pickleable in that situation would be fairly easy. |
Are you sure you'd still need to pickle the |
Probably re-initializing the layout would be more efficient 👍 |
databases/sets and queries should always be re-initialized except to preserve prior state (for reproducibility). this is why datagrabber and its forms always run, because we have no way of guaranteeing that things have not changed. but if we could do that, say with a db file, we can then hash it. |
We could easily add a read-only option to |
@tyarkoni - the most common use case for bids in a lab is in an ongoing study, so they would likely want to reindex as participants or sessions are added. but having a parameter would be very useful. if set to readonly, we can hash, if not, we reindex the layout. |
Okay, this is added in the 0.9 WIP. By default, each I decided not to add a read-only option, as it's actually not so easy to accidentally write to the DB (you would need to explicitly retrieve the The way I see it, if a user is using a DB file on disk, and is incrementally adding data to the dataset, it's on them to pass |
The main use case that leads me to propose this is a Nipype workflow running across multiple processes. Currently, since BIDSLayout is not pickleable, all individual interfaces relying on a layout object will need to instantiate and index a bids root. It would be great to be able to have a shared object that indexes the folder only once (and I think that requires pickling).
The text was updated successfully, but these errors were encountered: