U
    e»{j�  ã                   @   sl   d dl Zd dlZd dlmZ d dlmZmZ d dl	m
Z
 G dd„ deƒZdd„ Zej d	eƒ ¡d
d„ ƒZdS )é    N)Úunits)ÚModelÚ
fix_inputs)ÚPolynomial1Dc                       s,   e Zd ZdZdZ‡ fdd„Zdd„ Z‡  ZS )Ú_ExampleModelé   c                    s,   dt ji| _dt jt j i| _tƒ  ¡  d S )NÚxÚy)ÚuÚmÚ_input_unitsÚsÚ_return_unitsÚsuperÚ__init__)Úself©Ú	__class__© úh/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/modeling/tests/test_units_mapping.pyr      s    z_ExampleModel.__init__c                 C   s   |t  dt j¡ S )Nr   )r
   ZQuantityr   )r   Úinputr   r   r   Úevaluate   s    z_ExampleModel.evaluate)Ú__name__Ú
__module__Ú__qualname__Zn_inputsZ	n_outputsr   r   Ú__classcell__r   r   r   r   r   
   s   r   c            	      C   s.  t ƒ t ƒ @ } t ƒ t ƒ  }tdƒ}dtjtj i|_dtjtj i|_t ƒ |B }t| ddiƒ}t| ddiƒ}| ||||g}t d¡t d¡dœdt d¡idt d¡idt d¡idt d¡ig}t d	¡t d	¡d
œdt d	¡idt d	¡it d	¡t d	¡d
œt d	¡t d	¡d
œg}t	j
|||gtd�jS )Nr   r   r	   Úx0r   r   )r   Úx1r   zm / s)Zy0Úy1)Zdtype)r   r   r
   r   r   r   r   r   ZUnitÚnpÚarrayÚobjectÚT)	Úm1Úm2ÚpZm3Zm4Zm5ÚmodelsÚinput_unitsÚreturn_unitsr   r   r   Ú_models_with_units   s,    
û	ûr)   ©Úmodelr'   r(   c                 C   s    | j |kst‚| j|kst‚dS )z,Test input_units on various compound models.N)r'   ÚAssertionErrorr(   r*   r   r   r   Útest_input_units4   s    r-   )Únumpyr   ZpytestZastropyr   r
   Zastropy.modeling.corer   r   Zastropy.modeling.modelsr   r   r)   ÚmarkZparametrizer-   r   r   r   r   Ú<module>   s   