U
    f»{j~  ã                   @   s€   d dl mZ d dlZd dlmZ d dlZd dlm	Z	 d dl
mZ d dlmZmZ ejdd�Ze edd	d
d¡Zejdd„ ƒZdS )é    N)Úassert_almost_equal)Úread_source_spaces)Útesting)Úsimulate_sparse_stcÚsource_estimate_quantificationF)ÚdownloadZsubjectsÚsampleZbemzsample-oct-6-src.fifc            
      C   s  t tƒ} t d¡d }tj d¡}t| d||d�}t| d||d�}t||dd�}t||dd�}t||dd�}t||dd�}|d	ks†t‚|d	ks’t‚t	|d	ƒ t	|d	ƒ | 
¡  d
d¡}	t tt||	¡ | 
¡ }	|	 jd8  _t tt||	¡ tjtt||dd� dS )zTest simulation metrics.iX  g     @�@é*   é   )Z	n_dipolesÚtimesZrandom_stateZrms)ZmetricZcosineg        r   g      à?gš™™™™™¹?ZfooN)r   Ú	src_fnameÚnpZarangeÚrandomZRandomStater   r   ÚAssertionErrorr   ÚcopyÚcropÚpytestZraisesÚ
ValueErrorZtmin)
Úsrcr   ÚrngZstc1Zstc2ZE1_rmsZE2_rmsZE1_cosZE2_cosZstc_bad© r   ú`/var/www/html/bwave/python/venv/lib/python3.8/site-packages/mne/simulation/tests/test_metrics.pyÚtest_metrics   s*    

ÿr   )Úos.pathÚpathÚopÚnumpyr   Znumpy.testingr   r   Zmner   Zmne.datasetsr   Zmne.simulationr   r   Z	data_pathÚjoinr   Zrequires_testing_datar   r   r   r   r   Ú<module>   s   ÿ