xarray.backends.ScipyDataStore.load

xarray.backends.ScipyDataStore.load#

ScipyDataStore.load()[source]#

This loads the variables and attributes simultaneously. A centralized loading function makes it easier to create data stores that do automatic encoding/decoding.

For example:

class SuffixAppendingDataStore(AbstractDataStore):
    def load(self):
        variables, attributes = AbstractDataStore.load(self)
        variables = {"%s_suffix" % k: v for k, v in variables.items()}
        attributes = {"%s_suffix" % k: v for k, v in attributes.items()}
        return variables, attributes

This function will be called anytime variables or attributes are requested, so care should be taken to make sure its fast.