def array_info(self, dump=None, paths=None, attrs=True,
                   standardize_dims=True, pwd=None, use_rel_paths=True,
                   alternative_paths={}, ds_description={'fname', 'store'},
                   full_ds=True, copy=False, **kwargs):
        """
        Get dimension informations on you arrays

        This method returns a dictionary containing informations on the
        array in this instance

        Parameters
        ----------
        dump: bool
            If True and the dataset has not been dumped so far, it is dumped to
            a temporary file or the one generated by `paths` is used. If it is
            False or both, `dump` and `paths` are None, no data will be stored.
            If it is None and `paths` is not None, `dump` is set to True.
        %(get_filename_ds.parameters.no_ds|dump)s
        attrs: bool, optional
            If True (default), the :attr:`ArrayList.attrs` and
            :attr:`xarray.DataArray.attrs` attributes are included in the
            returning dictionary
        standardize_dims: bool, optional
            If True (default), the real dimension names in the dataset are
            replaced by x, y, z and t to be more general.
        pwd: str
            Path to the working directory from where the data can be imported.
            If None, use the current working directory.
        use_rel_paths: bool, optional
            If True (default), paths relative to the current working directory
            are used. Otherwise absolute paths to `pwd` are used
        ds_description: 'all' or set of {'fname', 'ds', 'num', 'arr', 'store'}
            Keys to describe the datasets of the arrays. If all, all keys
            are used. The key descriptions are

            fname
                the file name is inserted in the ``'fname'`` key
            store
                the data store class and module is inserted in the ``'store'``
                key
            ds
                the dataset is inserted in the ``'ds'`` key
            num
                The unique number assigned to the dataset is inserted in the
                ``'num'`` key
            arr
                The array itself is inserted in the ``'arr'`` key
        full_ds: bool
            If True and ``'ds'`` is in `ds_description`, the entire dataset is
            included. Otherwise, only the DataArray converted to a dataset is
            included
        copy: bool
            If True, the arrays and datasets are deep copied


        Other Parameters
        ----------------
        %(get_filename_ds.other_parameters)s

        Returns
        -------
        OrderedDict
            An ordered mapping from array names to dimensions and filename
            corresponding to the array

        See Also
        --------
        from_dict"""
        saved_ds = kwargs.pop('_saved_ds', {})

        def get_alternative(f):
            return next(filter(lambda t: osp.samefile(f, t[0]),
                               six.iteritems(alternative_paths)), [False, f])

        if copy:
            def copy_obj(obj):
                # try to get the number of the dataset and create only one copy
                # copy for each dataset
                try:
                    num = obj.psy.num
                except AttributeError:
                    pass
                else:
                    try:
                        return saved_ds[num]
                    except KeyError:
                        saved_ds[num] = obj.psy.copy(True)
                        return saved_ds[num]
                return obj.psy.copy(True)
        else:
            def copy_obj(obj):
                return obj
        ret = OrderedDict()
        if ds_description == 'all':
            ds_description = {'fname', 'ds', 'num', 'arr', 'store'}
        if paths is not None:
            if dump is None:
                dump = True
            paths = iter(paths)
        elif dump is None:
            dump = False
        if pwd is None:
            pwd = getcwd()
        for arr in self:
            if isinstance(arr, InteractiveList):
                ret[arr.arr_name] = arr.array_info(
                    dump, paths, pwd=pwd, attrs=attrs,
                    standardize_dims=standardize_dims,
                    use_rel_paths=use_rel_paths, ds_description=ds_description,
                    alternative_paths=alternative_paths, copy=copy,
                    _saved_ds=saved_ds, **kwargs)
            else:
                if standardize_dims:
                    idims = arr.psy.decoder.standardize_dims(
                        next(arr.psy.iter_base_variables), arr.psy.idims)
                else:
                    idims = arr.psy.idims
                ret[arr.psy.arr_name] = d = {'dims': idims}
                if 'variable' in arr.coords:
                    d['name'] = [list(arr.coords['variable'].values)]
                else:
                    d['name'] = arr.name
                if 'fname' in ds_description or 'store' in ds_description:
                    fname, store_mod, store_cls = get_filename_ds(
                        arr.psy.base, dump=dump, paths=paths, **kwargs)
                    if 'store' in ds_description:
                        d['store'] = (store_mod, store_cls)
                    if 'fname' in ds_description:
                        d['fname'] = []
                        for i, f in enumerate(safe_list(fname)):
                            if (f is None or utils.is_remote_url(f)):
                                d['fname'].append(f)
                            else:
                                found, f = get_alternative(f)
                                if use_rel_paths:
                                    f = osp.relpath(f, pwd)
                                else:
                                    f = osp.abspath(f)
                                d['fname'].append(f)
                        if fname is None or isinstance(fname,
                                                       six.string_types):
                            d['fname'] = d['fname'][0]
                        else:
                            d['fname'] = tuple(safe_list(fname))
                        if arr.psy.base.psy._concat_dim is not None:
                            d['concat_dim'] = arr.psy.base.psy._concat_dim
                if 'ds' in ds_description:
                    if full_ds:
                        d['ds'] = copy_obj(arr.psy.base)
                    else:
                        d['ds'] = copy_obj(arr.to_dataset())
                if 'num' in ds_description:
                    d['num'] = arr.psy.base.psy.num
                if 'arr' in ds_description:
                    d['arr'] = copy_obj(arr)
                if attrs:
                    d['attrs'] = arr.attrs
        ret['attrs'] = self.attrs
        return ret
def array_info ( self , dump = None , paths = None , attrs = True , standardize_dims = True , pwd = None , use_rel_paths = True , alternative_paths = { } , ds_description = { 'fname' , 'store' } , full_ds = True , copy = False , ** kwargs ) : saved_ds = kwargs . pop ( '_saved_ds' , { } ) def get_alternative ( f ) : return next ( filter ( lambda t : osp . samefile ( f , t [ 0 ] ) , six . iteritems ( alternative_paths ) ) , [ False , f ] ) if copy : def copy_obj ( obj ) : try : num = obj . psy . num except AttributeError : pass else : try : return saved_ds [ num ] except KeyError : saved_ds [ num ] = obj . psy . copy ( True ) return saved_ds [ num ] return obj . psy . copy ( True ) else : def copy_obj ( obj ) : return obj ret = OrderedDict ( ) if ds_description == 'all' : ds_description = { 'fname' , 'ds' , 'num' , 'arr' , 'store' } if paths is not None : if dump is None : dump = True paths = iter ( paths ) elif dump is None : dump = False if pwd is None : pwd = getcwd ( ) for arr in self : if isinstance ( arr , InteractiveList ) : ret [ arr . arr_name ] = arr . array_info ( dump , paths , pwd = pwd , attrs = attrs , standardize_dims = standardize_dims , use_rel_paths = use_rel_paths , ds_description = ds_description , alternative_paths = alternative_paths , copy = copy , _saved_ds = saved_ds , ** kwargs ) else : if standardize_dims : idims = arr . psy . decoder . standardize_dims ( next ( arr . psy . iter_base_variables ) , arr . psy . idims ) else : idims = arr . psy . idims ret [ arr . psy . arr_name ] = d = { 'dims' : idims } if 'variable' in arr . coords : d [ 'name' ] = [ list ( arr . coords [ 'variable' ] . values ) ] else : d [ 'name' ] = arr . name if 'fname' in ds_description or 'store' in ds_description : fname , store_mod , store_cls = get_filename_ds ( arr . psy . base , dump = dump , paths = paths , ** kwargs ) if 'store' in ds_description : d [ 'store' ] = ( store_mod , store_cls ) if 'fname' in ds_description : d [ 'fname' ] = [ ] for i , f in enumerate ( safe_list ( fname ) ) : if ( f is None or utils . is_remote_url ( f ) ) : d [ 'fname' ] . append ( f ) else : found , f = get_alternative ( f ) if use_rel_paths : f = osp . relpath ( f , pwd ) else : f = osp . abspath ( f ) d [ 'fname' ] . append ( f ) if fname is None or isinstance ( fname , six . string_types ) : d [ 'fname' ] = d [ 'fname' ] [ 0 ] else : d [ 'fname' ] = tuple ( safe_list ( fname ) ) if arr . psy . base . psy . _concat_dim is not None : d [ 'concat_dim' ] = arr . psy . base . psy . _concat_dim if 'ds' in ds_description : if full_ds : d [ 'ds' ] = copy_obj ( arr . psy . base ) else : d [ 'ds' ] = copy_obj ( arr . to_dataset ( ) ) if 'num' in ds_description : d [ 'num' ] = arr . psy . base . psy . num if 'arr' in ds_description : d [ 'arr' ] = copy_obj ( arr ) if attrs : d [ 'attrs' ] = arr . attrs ret [ 'attrs' ] = self . attrs return ret
Get dimension informations on you arrays

        This method returns a dictionary containing informations on the
        array in this instance

        Parameters
        ----------
        dump: bool
            If True and the dataset has not been dumped so far, it is dumped to
            a temporary file or the one generated by `paths` is used. If it is
            False or both, `dump` and `paths` are None, no data will be stored.
            If it is None and `paths` is not None, `dump` is set to True.
        %(get_filename_ds.parameters.no_ds|dump)s
        attrs: bool, optional
            If True (default), the :attr:`ArrayList.attrs` and
            :attr:`xarray.DataArray.attrs` attributes are included in the
            returning dictionary
        standardize_dims: bool, optional
            If True (default), the real dimension names in the dataset are
            replaced by x, y, z and t to be more general.
        pwd: str
            Path to the working directory from where the data can be imported.
            If None, use the current working directory.
        use_rel_paths: bool, optional
            If True (default), paths relative to the current working directory
            are used. Otherwise absolute paths to `pwd` are used
        ds_description: 'all' or set of {'fname', 'ds', 'num', 'arr', 'store'}
            Keys to describe the datasets of the arrays. If all, all keys
            are used. The key descriptions are

            fname
                the file name is inserted in the ``'fname'`` key
            store
                the data store class and module is inserted in the ``'store'``
                key
            ds
                the dataset is inserted in the ``'ds'`` key
            num
                The unique number assigned to the dataset is inserted in the
                ``'num'`` key
            arr
                The array itself is inserted in the ``'arr'`` key
        full_ds: bool
            If True and ``'ds'`` is in `ds_description`, the entire dataset is
            included. Otherwise, only the DataArray converted to a dataset is
            included
        copy: bool
            If True, the arrays and datasets are deep copied


        Other Parameters
        ----------------
        %(get_filename_ds.other_parameters)s

        Returns
        -------
        OrderedDict
            An ordered mapping from array names to dimensions and filename
            corresponding to the array

        See Also
        --------
        from_dict