GRIB field metadata caching
The use-grib-metadata-cache config option controls whether GRIB fields will cache their metadata access. The default value is True.
This is an in-memory cache attached to the field and implemented for the low-level metadata accessor for individual keys. Getting the values from the cache can be significantly faster than reading them from the GRIB handle, even when the handle is kept in memory.
This config option is applied to all the different GRIB field types, even for fields stored entirely in memory (see GRIB field memory management).
Overriding the configuration
In addition to changing the Configuration, it is possible to override use-grib-metadata-cache when loading a given fieldlist by passing the use_grib_metadata_cache keyword argument (note the underscores) to from_source(). When this kwarg is not specified in from_source() or is set to None, its value is taken from the actual Configuration. E.g.:
import earthkit.data as ekd
# will override the config
ds = ekd.from_source(
"file",
"test6.grib",
use_grib_metadata_cache=False,
)