a
    ß™fb‘	  ã                   @   sÒ   d Z ddlZddlmZ ddlmZ g d¢Zg d¢Zee Z	ddd	œZ
G d
d„ deƒZdd„ Zdd„ Zg Ze	D ]^Zee
v rªeeƒZee
e ƒZeƒ e eƒ e< e e¡ qneeƒZejZeeƒ e< e e¡ qndS )z 
Define Numpy Ufuncs as Models.
é    N)ÚModel)ÚAstropyUserWarning)ZsinZcosZtanZarcsinZarccosZarctanZarctan2ZhypotZsinhZcoshZtanhZarcsinhZarccoshZarctanhZdeg2radZrad2deg)ÚaddÚsubtractZmultiplyZ	logaddexpZ
logaddexp2Útrue_divideZfloor_divideÚnegativeZpositiveZpowerÚ	remainderZfmodÚdivmodZabsoluteZfabsZrintZexpZexp2ÚlogZlog2Zlog10Zexpm1Zlog1pZsqrtZsquareZcbrtZ
reciprocalÚdivideÚmodr   r   )r   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )Ú_NPUfuncModelTc                    s   t ƒ jf i |¤Ž d S ©N)ÚsuperÚ__init__)ÚselfÚkwargs©Ú	__class__© ú>lib/python3.9/site-packages/astropy/modeling/math_functions.pyr   &   s    z_NPUfuncModel.__init__)Ú__name__Ú
__module__Ú__qualname__Ú_is_dynamicr   Ú__classcell__r   r   r   r   r   #   s   r   c                 C   s   | d   ¡ | dd…  d S )z; Make a ufunc model class name from the name of the ufunc. r   é   NZUfunc)Úupper)Únamer   r   r   Ú_make_class_name*   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   Úevaluate7   s    zufunc_model.<locals>.evaluateFc                 S   s   |   ||¡S r   r    )r   r"   Úyr   r   r   r#   <   s    )Zn_inputsZ	n_outputsr!   ZlinearZfittableZ
_separabler   r#   zastropy.modeling.math_functions)	ÚgetattrÚnpÚninÚnoutr   ÚtypeÚstrr   r   )	r   Zufuncr'   r(   Z	separabler#   Ú
klass_nameÚmembersÚklassr   r   r   Úufunc_model/   s     

þr.   )Ú__doc__Znumpyr&   Zastropy.modeling.corer   Zastropy.utils.exceptionsr   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.   þ
