a
    yn„f[  ã                   @  sb   d dl mZ d dlZd dlmZ d dlmZ dZe 	¡ Z
eƒ ddddddd	œd
d„ƒZdd„ ZdS )é    )ÚannotationsN)Úhigh_level_function)ÚNumpyMetadata)Úfrom_rdataframeFÚint64T)Ú
keep_orderÚoffsets_typeÚ	with_nameÚ	highlevelÚbehaviorÚattrsc                C  s   t | ||||||ƒS )au  
    Args:
        rdf (`ROOT.RDataFrame`): ROOT RDataFrame to convert into an
            Awkward Array.
        columns (str or iterable of str): A column or multiple columns to be
            converted to Awkward Array.
        keep_order (bool): If set to `True` the columns with Awkward type will
            keep order after filtering.
        offsets_type (str): A `NumpyType.primitive` type of the ListOffsetArray
            offsets: `"int32"`, `"uint32"` or `"int64"`.
        with_name (None or str): Gives tuples and records a name that can be
            used to override their behavior (see #ak.Array).
        highlevel (bool): If True, return an #ak.Array; otherwise, return
            a low-level #ak.contents.Content subclass.
        behavior (None or dict): Custom #ak.behavior for the output array, if
            high-level.
        attrs (None or dict): Custom attributes for the output array, if
            high-level.

    Converts ROOT RDataFrame columns into an Awkward Array.

    If `columns` is a string, the return value represents a single RDataFrame column.

    If `columns` is any other iterable, the return value is a record array, in which
    each field corresponds to an RDataFrame column. In particular, if the `columns`
    iterable contains only one string, it is still a record array, which has only
    one field.

    See also #ak.to_rdataframe.
    )Ú_impl)ÚrdfÚcolumnsr   r   r	   r
   r   r   © r   úh/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/awkward/operations/ak_from_rdataframe.pyr      s    *r   c           
   	   C  s¬   dd l }t|tƒr|f}d}nt|ƒ}d}tdd„ |D ƒƒsJtd|›�ƒ‚t|tƒr\|dvrltd|›�ƒ‚n
|› d	�}tjjj	j	| ||||||d
�}	|r¤|	|d  S |	S d S )Nr   TFc                 s  s   | ]}t |tƒV  qd S )N)Ú
isinstanceÚstr)Ú.0Úxr   r   r   Ú	<genexpr>G   ó    z_impl.<locals>.<genexpr>z:'columns' must be a string or an iterable of strings, not )Zint32Zuint32r   z?'offsets_type' must be a string in (int32, uint32, int64), not Z_t)r
   r   r	   r   r   )
Z+awkward._connect.rdataframe.from_rdataframer   r   ÚtupleÚallÚ	TypeErrorÚakÚ_connectZ
rdataframer   )
Z
data_framer   r
   r   r	   r   r   ÚawkwardÚprojectÚoutr   r   r   r   ;   s:    
ÿÿÿ

ù
r   )Ú
__future__r   r   r   Zawkward._dispatchr   Zawkward._nplikes.numpy_liker   Ú__all__ÚinstanceÚnpr   r   r   r   r   r   Ú<module>   s   ÷,