# 0.7 to 0.8+

````{warning}
If your code still has bits like this:
```python
config.update(generate_inputs(
    bids_dir=config['bids_dir'],
    pybids_inputs=config['pybids_inputs'],
))
```

Check out the [pre-0.6 migration guide](/migration/0.5_to_0.8) to a guide on how to upgrade!
````

```{note}
Be sure to also [migrate](0.11_to_0.12.md) your `run.py` file to the new snakebids 0.12 syntax!
```


## Default return of {func}`~snakebids.generate_inputs()`

V0.8 switches the default return value of {func}`~snakebids.generate_inputs()` from {class}`~snakebids.BidsDatasetDict` to {class}`~snakebids.BidsDataset`. Legacy code still relying on the old dictionary can avoid the update by setting the `use_bids_inputs` parameter in {func}`~snakebids.generate_inputs()` to `False`:

```python
config.update(generate_inputs(
    bids_dir=config['bids_dir'],
    pybids_inputs=config['pybids_inputs'],
    use_bids_inputs=False,
))
```

Code that previously set `use_bids_inputs=True` should remove that line from {func}`~snakebids.generate_inputs()`. Such manual assignment is deprecated.

## Properties of {class}`~snakebids.BidsDataset`

The behaviour of the properties of {class}`~snakebids.BidsDataset`, including {attr}`~snakebids.BidsDataset.path`, {attr}`~snakebids.BidsDataset.zip_lists`, {attr}`~snakebids.BidsDataset.entities`, and {attr}`~snakebids.BidsDataset.wildcards` is set to change in an upcoming release, thus, their current use is deprecated. Code should now access these properties via the {class}`~snakebids.BidsComponent`. For instance:

```py
# deprecated in v0.8
inputs.wildcards["t1w"]
inputs.entities["t1w"]

# should now use
inputs["t1w"].wildcards
inputs["t1w"].entities
```

{#0_8_migration_expand_func}
## New {meth}`~snakebids.BidsComponent.expand` method

V0.8 features a new {meth}`~snakebids.BidsComponent.expand` method on {class}`~snakebids.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 {attr}`~snakebids.BidsComponent.path` or any number of provided paths. It should generally be preferred over snakemake's [`expand()`](#snakefiles_expand) when {class}`BidsComponents <snakebids.BidsComponent>` are involved, due to the increased safety and ease of use.

An [`expand`](#snakefiles_expand) call that used to look like this:

```py
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:

```py
rule all:
    input:
        inputs['bold'].expand(
            bids(
                root=root,
                desc="{smooth}",
                **inputs["bold"].wildcards,
            ),
            smooth=[1, 2, 3, 4],
        )
```
