Python code using
xarray.open_dataarray() or similar functions reading from NetCDF4 should consider using the
autoclose=True option, unless you have a specific reason for not using it.
autoclose=True option solves problems including:
segmentation faultwhile reading NetCDF4 .nc files, where the same file is reopened in the program.
OSErrorfrom too many open files, where even increasing
When to use
Many users may benefit from
autoclose=True, but if you aren’t having problems with existing code, perhaps the default
autoclose=False is fine for your application.