U
    e»{jë	  ã                   @   s  d Z ddlZddlmZ dddddd	d
dddddddddgZddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0gZee Zddd1œZG d2d3„ d3eƒZ	d4d5„ Z
d6d7„ Zg ZeD ]^Zeekrðe
eƒZe
ee ƒZeƒ e eƒ e< e e¡ q´eeƒZejZeeƒ e< e e¡ q´dS )8z 
Define Numpy Ufuncs as Models.
é    N)ÚModelÚsinÚcosÚtanZarcsinZarccosZarctanZarctan2ÚhypotÚsinhÚcoshÚtanhZarcsinhZarccoshZarctanhZdeg2radZrad2degÚaddÚsubtractÚmultiplyZ	logaddexpZ
logaddexp2Ztrue_divideZfloor_divideÚnegativeZpositiveÚpowerÚ	remainderÚfmodÚdivmodÚabsoluteÚfabsZrintÚexpZexp2ÚlogÚlog2Úlog10Úexpm1Úlog1pÚsqrtZsquareZcbrtZ
reciprocalÚdivideÚmod)r   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )Ú_NPUfuncModelTc                    s   t ƒ jf |Ž d S ©N)ÚsuperÚ__init__)ÚselfÚkwargs©Ú	__class__© ú^/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/modeling/math_functions.pyr    M   s    z_NPUfuncModel.__init__)Ú__name__Ú
__module__Ú__qualname__Ú_is_dynamicr    Ú__classcell__r%   r%   r#   r&   r   J   s   r   c                 C   s   | d   ¡ | dd…  d S )z9Make a ufunc model class name from the name of the ufunc.r   é   NZUfunc)Úupper)Únamer%   r%   r&   Ú_make_class_nameQ   s    r/   c           	   	   C   sr   t t| ƒ}|j}|j}|dkr,d}dd„ }nd}dd„ }t| ƒ}|||dd|d|dœ}tt|ƒtf|ƒ}d|_|S )	z'Define a Model from a Numpy ufunc name.r,   Tc                 S   s
   |   |¡S r   ©Úfunc)r!   Úxr%   r%   r&   Úevaluate^   s    zufunc_model.<locals>.evaluateFc                 S   s   |   ||¡S r   r0   )r!   r2   Úyr%   r%   r&   r3   d   s    )Zn_inputsZ	n_outputsr1   ZlinearZfittableZ
_separabler*   r3   zastropy.modeling.math_functions)	ÚgetattrÚnpÚninÚnoutr/   ÚtypeÚstrr   r(   )	r.   Zufuncr7   r8   Z	separabler3   Ú
klass_nameÚmembersÚklassr%   r%   r&   Úufunc_modelV   s*    

ør>   )Ú__doc__Únumpyr6   Zastropy.modeling.corer   Ztrig_ufuncsZmath_opsZsupported_ufuncsZalias_ufuncsr   r/   r>   Ú__all__r.   r;   Zalias_klass_nameÚglobalsÚappendÚmr'   r%   r%   r%   r&   Ú<module>   s†   ðã!þ#
