
    +d                     :    d dl mZ d dlmZ  G d de          ZdS )   )Catalog)LocalCatalogEntryc                   @     e Zd ZdZdZdZdZdZd
 fd	Zd Z	d	 Z
 xZS )ZarrGroupCatalogz)A catalog of the members of a Zarr group.z0.0.1catalogNzarr_catFc                     || _         |pi | _        || _        || _        d| _        || _        t                                          |           dS )a  

        Parameters
        ----------
        urlpath : str
            Location of data file(s), possibly including protocol information
        storage_options : dict, optional
            Passed on to storage backend for remote files
        component : str, optional
            If None, build a catalog from the root group. If given, build the
            catalog from the group at this location in the hierarchy.
        metadata : dict, optional
            Catalog metadata. If not provided, will be populated from Zarr
            group attributes.
        consolidated : bool, optional
            If True, assume Zarr metadata has been consolidated.
        N)metadata)_urlpath_storage_options
_component_consolidated_grpnamesuper__init__)selfurlpathstorage_options	componentr
   consolidatedr   	__class__s          3lib/python3.11/site-packages/intake/catalog/zarr.pyr   zZarrGroupCatalog.__init__   sW    $   / 52#)		(+++++    c           	         dd l }| j        t          | j        |j        j                  r| j        }nqt          | j        t                    rddlm}  || j        fi | j	        }n| j        }| j
        r|                    |d          }n|                    |d          }| j        || _        n|| j                 | _        | j                            | j        j                                                   i }| j                                        D ]h\  }}t          ||j        j                  r#t+          |ddt-          |          |           }n!t+          |dd	t-          |          
          }|||<   i|| _        d S )N    )
get_mapperr)storemode ndzarr)r   )r   descriptiondriverargsr   r   )r   r#   r$   r%   )zarrr   
isinstancer   	hierarchyGroupstrfsspecr   r   r   open_consolidated
open_groupr   r
   updateattrsasdictitemscoreArrayr   dict_entries)	r   r&   rootr   r   entrieskventrys	            r   _loadzZarrGroupCatalog._load'   s   9  	;$-)=>> B } dmS11 *111111&Jt}NN8MNNEE !ME % B11C1HHDD??S?AAD  2 		 1	 M  !7!7!9!9::: IOO%% 	 	DAq!TY_-- k)qbX\efXgXgXgquvvv)qbZ^ghZiZiZijjjGAJJr   c                     | j         S )N)r   )r   s    r   to_zarrzZarrGroupCatalog.to_zarrV   s
    yr   )NNNFN)__name__
__module____qualname____doc__version	containerpartition_accessr   r   r;   r=   __classcell__)r   s   @r   r   r      sw        33GID, , , , , ,4-  -  - ^      r   r   N)baser   localr   r    r   r   <module>rI      sg          $ $ $ $ $ $R R R R Rw R R R R Rr   