Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated autoclose option #2592

Closed
pwolfram opened this issue Dec 5, 2018 · 4 comments
Closed

Deprecated autoclose option #2592

pwolfram opened this issue Dec 5, 2018 · 4 comments

Comments

@pwolfram
Copy link
Contributor

pwolfram commented Dec 5, 2018

In updated versions of xarray we are getting a deprecation error for autoclose, e.g., at MPAS-Dev/MPAS-Analysis#501.

A look through the issues is not transparent as to this reason and this issue is to collect the high-level information on this change.

Is there an alternative use that should be considered instead?

@jhamman
Copy link
Member

jhamman commented Dec 5, 2018

@pwolfram - this option was deprecated in the last release following #2261. Xarray now uses a LRU cache to manage open file handles. This can be configured via a global option: xarray.set_options(file_cache_maxsize=...).

If I recall correctly, you were part of the early LRU cache conversations.

release notes on the subject: http://xarray.pydata.org/en/stable/whats-new.html#breaking-changes

@pwolfram
Copy link
Contributor Author

pwolfram commented Dec 5, 2018

@jhamman, LRU is much better. The api-change on our size is to replace autoclose=True with file_cache_maxsize=A_REASONABLE_BIG_NUMBER, correct?

@jhamman
Copy link
Member

jhamman commented Dec 5, 2018

@pwolfram - Thats right. We currently default to a fairly small number (128):

FILE_CACHE_MAXSIZE: 128,

@pwolfram
Copy link
Contributor Author

pwolfram commented Dec 5, 2018

Thanks @jhamman! @xylar, I'm thinking file_cache_maxsize=1200 would be a good default (100 years of monthly files) that could be modified via the config files we use.

@pwolfram pwolfram closed this as completed Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants