html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/6512#issuecomment-1109450011,https://api.github.com/repos/pydata/xarray/issues/6512,1109450011,IC_kwDOAMm_X85CIN0b,5635139,2022-04-26T07:33:37Z,2022-04-26T07:33:37Z,MEMBER,"Cool, if you think we should document it better (or write to a temp file by default, less surprising perhaps?), then that's great, let's add the issue; it doesn't have to be you who implements.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1109408693,https://api.github.com/repos/pydata/xarray/issues/6512,1109408693,IC_kwDOAMm_X85CIDu1,226037,2022-04-26T06:42:50Z,2022-04-26T06:42:50Z,MEMBER,"> Should we by default use a temp file? or is there some benefit to retaining the index file locally? (asking as someone with very little context
Opening the a GRIB for the first time requires reading the whole file and saving the index to disk makes all subsequent open much faster. I took the decision to default to writing, but IMO the real issue is that it is not well documented how to switch it off 😅 ","{""total_count"": 3, ""+1"": 3, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1109402183,https://api.github.com/repos/pydata/xarray/issues/6512,1109402183,IC_kwDOAMm_X85CICJH,5635139,2022-04-26T06:33:37Z,2022-04-26T06:33:37Z,MEMBER,Should we by default use a temp file? or is there some benefit to retaining the index file locally? (asking as someone with very little context{,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1109399455,https://api.github.com/repos/pydata/xarray/issues/6512,1109399455,IC_kwDOAMm_X85CIBef,226037,2022-04-26T06:29:57Z,2022-04-26T06:30:04Z,MEMBER,@isodrosotherm setting `indexpath=''` will suppress the use of the external index file.,"{""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 1, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1109378536,https://api.github.com/repos/pydata/xarray/issues/6512,1109378536,IC_kwDOAMm_X85CH8Xo,5821660,2022-04-26T06:01:00Z,2022-04-26T06:01:00Z,MEMBER,"You could point the index-file location to a temporary-folder, something along the lines of https://github.com/ecmwf/cfgrib/issues/275#issuecomment-1010002087.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1109296205,https://api.github.com/repos/pydata/xarray/issues/6512,1109296205,IC_kwDOAMm_X85CHoRN,2448579,2022-04-26T03:49:11Z,2022-04-26T03:49:11Z,MEMBER,cc @alexamici ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1109284506,https://api.github.com/repos/pydata/xarray/issues/6512,1109284506,IC_kwDOAMm_X85CHlaa,5635139,2022-04-26T03:42:27Z,2022-04-26T03:42:27Z,MEMBER,"I can repro, thanks @isodrosotherm .
It looks like we're passing this through to `cfgrib.open_file`: https://github.com/pydata/xarray/blob/main/xarray/backends/cfgrib_.py#L118.
Is this an xarray issue though? Or should upstream be cleaning up that file, assuming it should be cleaned up?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1109248716,https://api.github.com/repos/pydata/xarray/issues/6512,1109248716,IC_kwDOAMm_X85CHcrM,56264363,2022-04-26T02:58:39Z,2022-04-26T02:58:39Z,NONE,"here is the `xr.show_versions()`
```
>>> xr.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:06:49)
[Clang 12.0.1 ]
python-bits: 64
OS: Darwin
OS-release: 21.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.1
libnetcdf: 4.8.1
xarray: 0.19.0
pandas: 1.3.2
numpy: 1.20.3
scipy: 1.7.1
netCDF4: 1.5.7
pydap: installed
h5netcdf: 1.0.0
h5py: 3.6.0
Nio: None
zarr: 2.11.3
cftime: 1.5.1
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.9
cfgrib: 0.9.9.1
iris: None
bottleneck: None
dask: 2021.10.0
distributed: 2021.10.0
matplotlib: 3.4.3
cartopy: 0.20.0
seaborn: None
numbagg: None
pint: None
setuptools: 52.0.0.post20210125
pip: 21.0.1
conda: None
pytest: None
IPython: 8.1.1
sphinx: None
```
Here's [2022.grib.zip](https://github.com/pydata/xarray/files/8559356/2022.grib.zip) a file you can use for testing. And I believe this code should satisfy the MCVE request
```
import xarray as xr
fp = '2022.grib'
with xr.open_dataset(fp, backend_kwargs={'filter_by_keys': {'shortName': 'i10fg'}}) as ds:
m = ds.sel(time=ds.time.dt.month.isin([3]))
```
this code produced this [2022.grib.02ccc.idx.zip](https://github.com/pydata/xarray/files/8559372/2022.grib.02ccc.idx.zip) file and it didn't delete it once the code finished running.
Please let me know if you need any more info!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475
https://github.com/pydata/xarray/issues/6512#issuecomment-1108915557,https://api.github.com/repos/pydata/xarray/issues/6512,1108915557,IC_kwDOAMm_X85CGLVl,5635139,2022-04-25T18:44:24Z,2022-04-25T18:44:24Z,MEMBER,"Please could you confirm on the latest release of xarray, include the `xr.show_versions()`, and a MCVE?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1214654475