def _open_ds_from_store(fname, store_mod=None, store_cls=None, **kwargs):
    """Open a dataset and return it"""
    if isinstance(fname, xr.Dataset):
        return fname
    if not isstring(fname):
        try:  # test iterable
            fname[0]
        except TypeError:
            pass
        else:
            if store_mod is not None and store_cls is not None:
                if isstring(store_mod):
                    store_mod = repeat(store_mod)
                if isstring(store_cls):
                    store_cls = repeat(store_cls)
                fname = [_open_store(sm, sc, f)
                         for sm, sc, f in zip(store_mod, store_cls, fname)]
                kwargs['engine'] = None
                kwargs['lock'] = False
                return open_mfdataset(fname, **kwargs)
    if store_mod is not None and store_cls is not None:
        fname = _open_store(store_mod, store_cls, fname)
    return open_dataset(fname, **kwargs)
def _open_ds_from_store ( fname , store_mod = None , store_cls = None , ** kwargs ) : if isinstance ( fname , xr . Dataset ) : return fname if not isstring ( fname ) : try : fname [ 0 ] except TypeError : pass else : if store_mod is not None and store_cls is not None : if isstring ( store_mod ) : store_mod = repeat ( store_mod ) if isstring ( store_cls ) : store_cls = repeat ( store_cls ) fname = [ _open_store ( sm , sc , f ) for sm , sc , f in zip ( store_mod , store_cls , fname ) ] kwargs [ 'engine' ] = None kwargs [ 'lock' ] = False return open_mfdataset ( fname , ** kwargs ) if store_mod is not None and store_cls is not None : fname = _open_store ( store_mod , store_cls , fname ) return open_dataset ( fname , ** kwargs )
Open a dataset and return it