a
    yn„f=  ã                   @  s˜   d dl mZ d dlZd dlmZ d dlmZ d dlm	Z	 d dl
mZ dZe ¡ Zejj d¡ejj d	¡eƒ d ed
ddfddœdd	„ƒƒƒZdd„ ZdS )é    )ÚannotationsN)ÚUNSUPPORTED)Úhigh_level_function)ÚHighLevelContext)ÚNumpyMetadata)ÚroundZaroundr   TÚint©Údecimalsc                 c  s   | fV  t | ||||ƒS )a(  
    Args:
        array : array_like
            Input array.
        decimals : int, optional
            Number of decimal places to round to (default: 0).  If
            decimals is negative, it specifies the number of positions to
            the left of the decimal point.
        out : unsupported optional argument
        highlevel (bool, default is True): 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.

    Returns the real components of the given array elements.
    If the arrays have complex elements, the returned arrays are floats.
    )Ú_impl)Úarrayr
   ÚoutÚ	highlevelÚbehaviorÚattrs© r   ú^/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/awkward/operations/ak_round.pyr      s    c           	        sd   t ||d�� }|j| ddd�}W d   ƒ n1 s20    Y  ‡ fdd„}tj ||¡}|j||d�S )N)r   r   FÚerror)Zallow_recordZprimitive_policyc                   s.   t | tjjƒr&tj |j | jˆ ¡¡S d S d S )N)Ú
isinstanceÚakÚcontentsZ
NumpyArrayZnpliker   Údata)ÚlayoutÚbackendÚkwargsr	   r   r   Úaction:   s    z_impl.<locals>.action)r   )r   Úunwrapr   Z_doZrecursively_applyÚwrap)	r   r
   r   r   r   Úctxr   r   r   r   r	   r   r   5   s
    .r   )Ú
__future__r   Zawkwardr   Zawkward._connect.numpyr   Zawkward._dispatchr   Zawkward._layoutr   Zawkward._nplikes.numpy_liker   Ú__all__ÚinstanceÚnpÚ_connectÚnumpyZ
implementsr   r   r   r   r   r   Ú<module>   s"   ú"