0.7 to 0.8+¶
Warning
If your code still has bits like this:
1config.update(generate_inputs(
2 bids_dir=config['bids_dir'],
3 pybids_inputs=config['pybids_inputs'],
4))
Check out the pre-0.6 migration guide to a guide on how to upgrade!
Note
Be sure to also migrate your run.py
file to the new snakebids 0.12 syntax!
Default return of generate_inputs()
¶
V0.8 switches the default return value of generate_inputs()
from BidsDatasetDict
to BidsDataset
. Legacy code still relying on the old dictionary can avoid the update by setting the use_bids_inputs
parameter in generate_inputs()
to False
:
1config.update(generate_inputs(
2 bids_dir=config['bids_dir'],
3 pybids_inputs=config['pybids_inputs'],
4 use_bids_inputs=False,
5))
Code that previously set use_bids_inputs=True
should remove that line from generate_inputs()
. Such manual assignment is deprecated.
Properties of BidsDataset
¶
The behaviour of the properties of BidsDataset
, including path
, zip_lists
, entities
, and wildcards
is set to change in an upcoming release, thus, their current use is deprecated. Code should now access these properties via the BidsComponent
. For instance:
# deprecated in v0.8
inputs.wildcards["t1w"]
inputs.entities["t1w"]
# should now use
inputs["t1w"].wildcards
inputs["t1w"].entities
New expand()
method¶
V0.8 features a new expand()
method on BidsComponent
. This method automatically ensures only entity-values actually contained in your dataset are used when expanding over a path. It supports the addition of extra wildcards, and can expand over the component path
or any number of provided paths. It should generally be preferred over snakemake’s expand()
when BidsComponents
are involved, due to the increased safety and ease of use.
An expand
call that used to look like this:
rule all:
input:
expand(
expand(
bids(
root=root,
desc="{smooth}",
**inputs["bold"].wildcards,
),
allow_missing=True,
smooth=[1, 2, 3, 4],
),
zip,
**inputs["bold"].zip_lists,
)
can now be written like this:
rule all:
input:
inputs['bold'].expand(
bids(
root=root,
desc="{smooth}",
**inputs["bold"].wildcards,
),
smooth=[1, 2, 3, 4],
)