home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 464113917

This data as json

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/1385#issuecomment-464113917 https://api.github.com/repos/pydata/xarray/issues/1385 464113917 MDEyOklzc3VlQ29tbWVudDQ2NDExMzkxNw== 30007270 2019-02-15T16:34:02Z 2019-02-15T16:34:35Z NONE

On a related note, is it possible to clear out the memory used by the xarray dataset after it is no longer needed?

Here's an example:

python fname = '/work/xrc/AM4_xrc/c192L33_am4p0_cmip6Diag/daily/5yr/atmos.19800101-19841231.ucomp.nc'

python import xarray as xr

python with xr.set_options(file_cache_maxsize=1): %time ds = xr.open_mfdataset(fname)

CPU times: user 48 ms, sys: 124 ms, total: 172 ms
Wall time: 29.7 s

```python

fname2 = '/work/xrc/AM4_xrc/c192L33_am4p0_cmip6Diag/daily/5yr/atmos.20100101-20141231.ucomp.nc' ```

```python

with xr.set_options(file_cache_maxsize=1): %time ds = xr.open_mfdataset(fname2) # would like this to free up memory used by fname ```

CPU times: user 39 ms, sys: 124 ms, total: 163 ms
Wall time: 28.8 s

python import gc gc.collect()

```python

with xr.set_options(file_cache_maxsize=1): # expected to take same time as first call %time ds = xr.open_mfdataset(fname) ```

CPU times: user 28 ms, sys: 10 ms, total: 38 ms
Wall time: 37.9 ms
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  224553135
Powered by Datasette · Queries took 1.602ms · About: xarray-datasette