Skip to content

Commit

Permalink
remove some outdated occurrences of passing indexes={}
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNicholas committed Dec 18, 2024
1 parent cef3490 commit 84fe991
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ But before we combine our data, we might want to consider loading some variables
Whilst the values of virtual variables (i.e. those backed by `ManifestArray` objects) cannot be loaded into memory, you do have the option of opening specific variables from the file as loadable lazy numpy/dask arrays, just like `xr.open_dataset` normally returns. These variables are specified using the `loadable_variables` argument:

```python
vds = open_virtual_dataset('air.nc', loadable_variables=['air', 'time'], indexes={})
vds = open_virtual_dataset('air.nc', loadable_variables=['air', 'time'])
```
```python
<xarray.Dataset> Size: 31MB
Expand All @@ -228,8 +228,8 @@ You can see that the dataset contains a mixture of virtual variables backed by `
Loading variables can be useful in a few scenarios:
1. You need to look at the actual values of a multi-dimensional variable in order to decide what to do next,
2. You want in-memory indexes to use with ``xr.combine_by_coords``,
3. Storing a variable on-disk as a set of references would be inefficient, e.g. because it's a very small array (saving the values like this is similar to kerchunk's concept of "inlining" data),
4. The variable has encoding, and the simplest way to decode it correctly is to let xarray's standard decoding machinery load it into memory and apply the decoding.
3. Storing a variable on-disk as a set of references would be inefficient, e.g. because each chunk is very small (saving the values like this is similar to kerchunk's concept of "inlining" data),
4. The variable has complicated encoding, and the simplest way to decode it correctly is to let xarray's standard decoding machinery load it into memory and apply the decoding.

### CF-encoded time variables

Expand All @@ -240,7 +240,6 @@ vds = open_virtual_dataset(
'air.nc',
loadable_variables=['air', 'time'],
decode_times=True,
indexes={},
)
```
```python
Expand Down Expand Up @@ -341,7 +340,6 @@ In future we would like for it to be possible to just use `xr.open_mfdataset` to
concat_dim=['time'],
coords='minimal',
compat='override',
indexes={},
)
but this requires some [upstream changes](https://github.com/TomNicholas/VirtualiZarr/issues/35) in xarray.
Expand Down

0 comments on commit 84fe991

Please sign in to comment.