Ë
    éì�i�I  ã                   ól   — d dl Zd dlmZ d dlZd dlmZ d dlmZm	Z	m
Z
 d dlmZ ddlmZ  G d„ d	«      Zy)
é    N)Úassert_allclose)Úraises)Úbinned_statisticÚbinned_statistic_2dÚbinned_statistic_dd)Úcheck_random_stateé   )Úcheck_named_resultsc                   óZ  — e Zd Zed„ «       Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z d„ Z!d„ Z"d „ Z#d!„ Z$d"„ Z%d#„ Z&d$„ Z'd%„ Z(d&„ Z)d'„ Z*d(„ Z+d)„ Z,d*„ Z-d+„ Z.d,„ Z/e0jb                  je                  d-e3jh                  e3jj                  g«      e0jb                  je                  d.e3jl                  e3jn                  e3jp                  e3jr                  e3jt                  e3jv                  d/d0„ d1„ g	«      d2„ «       «       Z<y3)4ÚTestBinnedStatisticc                 ó4  — t        d«      }|j                  d¬«      | _        |j                  d¬«      | _        |j                  d¬«      | _        |j                  d¬«      | _        |j                  d¬«      | _        |j                  d¬«      dz   | _        y )Ni‰&  éd   ©Úsize)r   é   g    €„.A)r   ÚuniformÚxÚyÚvÚXÚwÚu)ÚclsÚrngs     úŒ/var/www/ITT-ServiceAPI-Services/ITT-Document-Scan/mrzscanner/mrzenv/lib/python3.12/site-packages/scipy/stats/tests/test_binned_statistic.pyÚsetup_classzTestBinnedStatistic.setup_class   s}   € ä  Ó&ˆØ—‘ �Ó%ˆŒØ—‘ �Ó%ˆŒØ—‘ �Ó%ˆŒØ—‘ �Ó*ˆŒØ—‘ �Ó%ˆŒØ—‘ �Ó%¨Ñ+ˆ�ó    c                 ó¾   — | j                   }| j                  }t        ||dd¬«      \  }}}t        j                  |d¬«      \  }}t        ||«       t        ||«       y )NÚcounté
   ©Úbins©r   r   r   ÚnpÚ	histogramr   )Úselfr   r   Úcount1Úedges1ÚbcÚcount2Úedges2s           r   Útest_1d_countz!TestBinnedStatistic.test_1d_count   sS   € Ø�F‰FˆØ�F‰Fˆä-¨a°°GÀ"ÔEÑˆ�˜ÜŸ™ a¨bÔ1‰ˆ�ä˜ Ô'Ü˜ Õ'r   c                 óh   — | j                   }| j                  }g d¢}|D ]  }t        |||d¬«       Œ y )N)ÚmeanÚmedianr   Úsumr    r!   )r   r   r   )r&   r   r   Ú
statisticsÚ	statistics        r   Útest_gh5927zTestBinnedStatistic.test_gh5927"   s8   € ð �F‰FˆØ�F‰FˆÚ7ˆ
Ø#ò 	7ˆIÜ˜Q  9°2Ö6ñ	7r   c                 ó´   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       y ©NÚstdr    r!   )r   r   r   r$   r6   r   ©r&   r   r   Ústat1r(   r)   Ústat2r+   s           r   Útest_big_number_stdz'TestBinnedStatistic.test_big_number_std+   sR   € ð �F‰FˆØ�F‰FˆÜ,¨Q°°5¸rÔBÑˆˆv�rÜ,¨Q°´2·6±6ÀÔCÑˆˆv�rä˜˜uÕ%r   c                 óä   — | j                   }| j                  }t        t        ||dd¬«      «       t        ||dd¬«      \  }}}t        ||t        j
                  d¬«      \  }}}t        ||«       y )Nr   iè  r!   r6   )r   r   Úprintr   r$   r6   r   r7   s           r   Útest_empty_bins_stdz'TestBinnedStatistic.test_empty_bins_std5   sd   € à�F‰FˆØ�F‰FˆÜÔ˜q ! W°4Ô8Ô9Ü,¨Q°°5¸tÔDÑˆˆv�rÜ,¨Q°´2·6±6ÀÔEÑˆˆv�rä˜˜uÕ%r   c           
      óX  — | j                   }| j                  j                  «       }t        j                  |d<   t        t        t        ||dd¬«       t        t        t        ||dt        j                  d«      ¬«       t        j                  |d<   t        t        t        ||dd¬«       y )Nr   r6   r    r!   r   )
r   r   Úcopyr$   ÚinfÚassert_raisesÚ
ValueErrorr   Úint64Únan)r&   r   r   s      r   Ú#test_non_finite_inputs_and_int_binsz7TestBinnedStatistic.test_non_finite_inputs_and_int_bins?   sz   € ð �F‰FˆØ�F‰F�K‰K‹MˆÜ�v‰vˆˆ!‰Ü”jÔ"2°A°q¸%ÀbÕIä”jÔ"2°A°q¸%ÜŸ8™8 B›<õ	)ä�v‰vˆˆ!‰Ü”jÔ"2°A°q¸'ÈÖKr   c                 ón   — | j                   }| j                  }t        ||dd¬«      }d}t        ||«       y )Nr   r    r!   ©r2   Ú	bin_edgesÚ	binnumber)r   r   r   r
   )r&   r   r   ÚresÚ
attributess        r   Útest_1d_result_attributesz-TestBinnedStatistic.test_1d_result_attributesL   s3   € Ø�F‰FˆØ�F‰Fˆä˜q ! W°2Ô6ˆØ<ˆ
Ü˜C Õ,r   c                 óÀ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        j                  |d|¬«      \  }}t        ||«       t        ||«       y )Nr0   r    r!   ©r"   Úweightsr#   )r&   r   r   Úsum1r(   r)   Úsum2r+   s           r   Útest_1d_sumzTestBinnedStatistic.test_1d_sumT   sU   € Ø�F‰FˆØ�F‰Fˆä+¨A¨q°%¸bÔAÑˆˆf�bÜ—|‘| A¨B¸Ô:‰ˆˆfä˜˜dÔ#Ü˜ Õ'r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )Nr.   r    r!   )r   r   r   r$   r.   r   ©r&   r   r   r8   r(   r)   r9   r+   s           r   Útest_1d_meanz TestBinnedStatistic.test_1d_mean^   sZ   € Ø�F‰FˆØ�F‰Fˆä,¨Q°°6ÀÔCÑˆˆv�rÜ,¨Q°´2·7±7ÀÔDÑˆˆv�rä˜˜uÔ%Ü˜ Õ'r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y r5   )r   r   r   r$   r6   r   rT   s           r   Útest_1d_stdzTestBinnedStatistic.test_1d_stdh   óZ   € Ø�F‰FˆØ�F‰Fˆä,¨Q°°5¸rÔBÑˆˆv�rÜ,¨Q°´2·6±6ÀÔCÑˆˆv�rä˜˜uÔ%Ü˜ Õ'r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )NÚminr    r!   )r   r   r   r$   rZ   r   rT   s           r   Útest_1d_minzTestBinnedStatistic.test_1d_minr   rX   r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )NÚmaxr    r!   )r   r   r   r$   r]   r   rT   s           r   Útest_1d_maxzTestBinnedStatistic.test_1d_max|   rX   r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )Nr/   r    r!   )r   r   r   r$   r/   r   rT   s           r   Útest_1d_medianz"TestBinnedStatistic.test_1d_median†   sZ   € Ø�F‰FˆØ�F‰Fˆä,¨Q°°8À"ÔEÑˆˆv�rÜ,¨Q°´2·9±9À2ÔFÑˆˆv�rä˜˜uÔ%Ü˜ Õ'r   c                 ó4  — | j                   d d }| j                  d d }t        ||dd¬«      \  }}}t        j                  g d¢«      }t        j
                  |«      D �cg c]  }||k(  j                  «       ‘Œ }}t        ||«       t        ||«       y c c}w )Né   r   r   r!   )r   é   r	   r   rc   r   r   r   r   r	   r	   r   r   r	   rc   r   r	   r	   rc   r	   )r   r   r   r$   ÚarrayÚuniquer0   r   )	r&   r   r   r'   r(   r)   Úbc2ÚiÚbcounts	            r   Útest_1d_bincodez#TestBinnedStatistic.test_1d_bincode�   sŠ   € Ø�F‰F�3�BˆKˆØ�F‰F�3�BˆKˆä-¨a°°GÀ!ÔDÑˆ�˜Ü�h‰hò !ó "ˆô ,.¯9©9°R«=Ö9 a�2˜‘7—-‘-•/Ð9ˆÐ9ä˜˜CÔ Ü˜ Õ'ùò :s   Á Bc                 ód  — t         j                  j                  d«      }t        j                  d«      }|j                  d«      }t	        |d d |d d «      \  }}}t	        ||dg¬«      \  }}}t	        ||d¬«      \  }	}
}t        ||«       t        ||«       t        ||	«       t        ||
«       y )Nl   Ù p- é   é   )r   é   ©Úrange)r$   ÚrandomÚdefault_rngÚaranger   r   )r&   r   r   Údatar.   r"   Ú_Ú
mean_rangeÚ
bins_rangeÚmean_range2Úbins_range2s              r   Útest_1d_range_keywordz)TestBinnedStatistic.test_1d_range_keyword�   s¢   € ä�i‰i×#Ñ# JÓ/ˆÜ�I‰I�b‹MˆØ�z‰z˜"‹~ˆä(¨¨3¨B¨°°c°r°Ó;‰ˆˆd�AÜ$4°Q¸ÀWÀIÔ$NÑ!ˆ
�J Ü&6°q¸$ÀgÔ&NÑ#ˆ�[ !ä˜˜jÔ)Ü˜˜jÔ)Ü˜˜kÔ*Ü˜˜kÕ*r   c                 ó.  — | j                   }| j                  }| j                  }t        ||dd¬«      \  }}}t        ||dd¬«      \  }}}	t        |||gdd¬«      \  }
}}t	        |
d   |«       t	        |
d   |«       t	        ||«       t	        ||«       y )Nr.   r    r!   r   r	   )r   r   r   r   r   )r&   r   r   r   Ústat1vÚedges1vÚbc1vÚstat1wÚedges1wÚbc1wr9   r+   rf   s                r   Útest_1d_multi_valuesz(TestBinnedStatistic.test_1d_multi_values¬   s–   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä 0°°A°vÀBÔ GÑˆ�˜Ü 0°°A°vÀBÔ GÑˆ�˜Ü-¨a°!°Q°¸ÀbÔIÑˆˆv�sä˜˜a™ &Ô)Ü˜˜a™ &Ô)Ü˜ Ô(Ü˜˜cÕ"r   c                 óö   — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t	        j
                  ||d¬«      \  }}	}
t        ||«       t        ||	«       t        ||
«       y )Nr   é   r!   ©r   r   r   r   r$   Úhistogram2dr   )r&   r   r   r   r'   Úbinx1Úbiny1r)   r*   Úbinx2Úbiny2s              r   Útest_2d_countz!TestBinnedStatistic.test_2d_countº   sr   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä#6Øˆq�!�W 1ô$&Ñ ˆ��u˜bä!Ÿ~™~¨a°¸Ô;Ñˆ��uä˜ Ô'Ü˜˜uÔ%Ü˜˜uÕ%r   c                 óˆ   — | j                   }| j                  }| j                  }t        |||dd¬«      }d}t	        ||«       y )Nr   rƒ   r!   )r2   Úx_edgeÚy_edgerI   )r   r   r   r   r
   )r&   r   r   r   rJ   rK   s         r   Útest_2d_result_attributesz-TestBinnedStatistic.test_2d_result_attributesÇ   s>   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä! ! Q¨¨7¸Ô;ˆØCˆ
Ü˜C Õ,r   c                 óø   — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t	        j
                  ||d|¬«      \  }}	}
t        ||«       t        ||	«       t        ||
«       y )Nr0   rƒ   r!   rN   r„   )r&   r   r   r   rP   r†   r‡   r)   rQ   rˆ   r‰   s              r   Útest_2d_sumzTestBinnedStatistic.test_2d_sumÐ   sq   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä!4°Q¸¸1¸eÈ!Ô!LÑˆˆe�U˜BÜŸ^™^¨A¨q°qÀ!ÔDÑˆˆe�Uä˜˜dÔ#Ü˜˜uÔ%Ü˜˜uÕ%r   c                 ó  — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t        |||t        j
                  d¬«      \  }}	}
}t        ||«       t        ||	«       t        ||
«       y ©Nr.   rƒ   r!   ©r   r   r   r   r$   r.   r   ©r&   r   r   r   r8   r†   r‡   r)   r9   rˆ   r‰   s              r   Útest_2d_meanz TestBinnedStatistic.test_2d_meanÜ   su   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä"5°a¸¸A¸vÈAÔ"NÑˆˆu�e˜RÜ"5°a¸¸A¼r¿w¹wÈQÔ"OÑˆˆu�e˜Rä˜˜uÔ%Ü˜˜uÔ%Ü˜˜uÕ%r   c                 ó  — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t        |||t        j
                  d¬«      \  }}	}
}t        ||«       t        ||	«       t        ||
«       y r’   r“   r”   s              r   Útest_2d_mean_unicodez(TestBinnedStatistic.test_2d_mean_unicodeè   sx   € Ø�F‰FˆØ�F‰FˆØ�F‰FˆÜ"5Øˆq�!�V !ô#%Ñˆˆu�e˜Rä"5°a¸¸A¼r¿w¹wÈQÔ"OÑˆˆu�e˜RÜ˜˜uÔ%Ü˜˜uÔ%Ü˜˜uÕ%r   c                 ó  — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t        |||t        j
                  d¬«      \  }}	}
}t        ||«       t        ||	«       t        ||
«       y )Nr6   rƒ   r!   )r   r   r   r   r$   r6   r   r”   s              r   Útest_2d_stdzTestBinnedStatistic.test_2d_stdó   óu   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä"5°a¸¸A¸uÈ1Ô"MÑˆˆu�e˜RÜ"5°a¸¸A¼r¿v¹vÈAÔ"NÑˆˆu�e˜Rä˜˜uÔ%Ü˜˜uÔ%Ü˜˜uÕ%r   c                 ó  — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t        |||t        j
                  d¬«      \  }}	}
}t        ||«       t        ||	«       t        ||
«       y )NrZ   rƒ   r!   )r   r   r   r   r$   rZ   r   r”   s              r   Útest_2d_minzTestBinnedStatistic.test_2d_minÿ   rš   r   c                 ó  — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t        |||t        j
                  d¬«      \  }}	}
}t        ||«       t        ||	«       t        ||
«       y )Nr]   rƒ   r!   )r   r   r   r   r$   r]   r   r”   s              r   Útest_2d_maxzTestBinnedStatistic.test_2d_max  rš   r   c                 ó  — | j                   }| j                  }| j                  }t        |||dd¬«      \  }}}}t        |||t        j
                  d¬«      \  }}	}
}t        ||«       t        ||	«       t        ||
«       y )Nr/   rƒ   r!   )r   r   r   r   r$   r/   r   r”   s              r   Útest_2d_medianz"TestBinnedStatistic.test_2d_median  s}   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä"5Øˆq�!�X Aô#'Ñˆˆu�e˜Rä"5Øˆq�!”R—Y‘Y Qô#(Ñˆˆu�e˜Rô 	˜˜uÔ%Ü˜˜uÔ%Ü˜˜uÕ%r   c                 ó|  — | j                   d d }| j                  d d }| j                  d d }t        |||dd¬«      \  }}}}t	        j
                  g d¢«      }t	        j                  |«      D �	cg c]  }	||	k(  j                  «       ‘Œ }
}	t        ||«       ||j                  «          }t        |
|«       y c c}	w )Nrb   r   r   r!   )é   é   é   é   r£   r¢   é   r¢   r¢   é   r¤   r¦   r¥   r¤   r£   r¥   r¤   r¤   r£   é   )
r   r   r   r   r$   rd   re   r0   r   Únonzero)r&   r   r   r   r'   r†   r‡   r)   rf   rg   rh   Ú	count1adjs               r   Útest_2d_bincodez#TestBinnedStatistic.test_2d_bincode%  s±   € Ø�F‰F�3�BˆKˆØ�F‰F�3�BˆKˆØ�F‰F�3�BˆKˆä#6Øˆq�!�W 1ô$&Ñ ˆ��u˜bä�h‰hò 0ó 1ˆô ,.¯9©9°R«=Ö9 a�2˜‘7—-‘-•/Ð9ˆÐ9ä˜˜CÔ Ø˜6Ÿ>™>Ó+Ñ,ˆ	Ü˜ 	Õ*ùò	 :s   Á1B9c                 ój  — | j                   }| j                  }| j                  }| j                  }t	        |||dd¬«      \  }}}}t	        |||dd¬«      \  }	}
}}t	        ||||gdd¬«      \  }}}}t        |d   |«       t        |d   |	«       t        ||«       t        ||«       t        ||«       y )Nr.   r¨   r!   r   r	   )r   r   r   r   r   r   )r&   r   r   r   r   r{   Úbinx1vÚbiny1vr}   r~   Úbinx1wÚbiny1wr€   r9   rˆ   r‰   rf   s                    r   Útest_2d_multi_valuesz(TestBinnedStatistic.test_2d_multi_values5  sÀ   € Ø�F‰FˆØ�F‰FˆØ�F‰FˆØ�F‰Fˆä':Øˆq�!�V !ô(%Ñ$ˆ�˜ ä':Øˆq�!�V !ô(%Ñ$ˆ�˜ ä#6Øˆq�1�a�&˜& qô$*Ñ ˆˆu�e˜Sô 	˜˜a™ &Ô)Ü˜˜a™ &Ô)Ü˜ Ô&Ü˜ Ô&Ü˜˜cÕ"r   c                 ó  — | j                   }| j                  }| j                  }t        ||dd¬«      \  }}}t        ||dd¬«      \  }}}t	        |||ddd¬«      \  }	}
}}t        j                  ||d¬	«      }t        j                  ||d¬	«      }|||j                  «       k(  xx   d
z  cc<   |||j                  «       k(  xx   d
z  cc<   t        ||d   «       t        ||d
   «       t        ||d   «       t        ||d
   «       y )Nr.   rb   r!   r    )rb   r    T©r"   Úexpand_binnumbersÚright)Úsider	   r   )	r   r   r   r   r   r$   Úsearchsortedr]   r   )r&   r   r   r   ÚstatÚedgesxÚbcxÚedgesyÚbcyr9   Úedgesx2Úedgesy2rf   Úbcx3Úbcy3s                  r   Útest_2d_binnumbers_unraveledz0TestBinnedStatistic.test_2d_binnumbers_unraveledH  s   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆä,¨Q°°6ÀÔCÑˆˆf�cÜ,¨Q°°6ÀÔCÑˆˆf�cä':Øˆq�!�V (¸dô(DÑ$ˆˆw˜ ô �‰˜v q¨wÔ7ˆÜ�‰˜v q¨wÔ7ˆð 	ˆQ�!—%‘%“'‰\Ó˜aÑÓØˆQ�!—%‘%“'‰\Ó˜aÑÓä˜˜S ™VÔ$Ü˜˜S ™VÔ$Ü˜˜c !™fÔ%Ü˜˜c !™fÕ%r   c                 ó¾   — | j                   }| j                  }t        ||dd¬«      \  }}}t        j                  |d¬«      \  }}t        ||«       t        ||«       y )Nr   r   r!   )r   r   r   r$   Úhistogramddr   )r&   r   r   r'   r(   r)   r*   r+   s           r   Útest_dd_countz!TestBinnedStatistic.test_dd_count_  sS   € Ø�F‰FˆØ�F‰Fˆä0°°A°wÀQÔGÑˆ�˜ÜŸ™¨°Ô2‰ˆ�ä˜ Ô'Ü˜ Õ'r   c                 ón   — | j                   }| j                  }t        ||dd¬«      }d}t        ||«       y )Nr   r   r!   rG   )r   r   r   r
   )r&   r   r   rJ   rK   s        r   Útest_dd_result_attributesz-TestBinnedStatistic.test_dd_result_attributesi  s3   € Ø�F‰FˆØ�F‰Fˆä! ! Q¨°aÔ8ˆØ<ˆ
Ü˜C Õ,r   c                 ó2  — | j                   }| j                  }t        ||dd¬«      \  }}}t        j                  |d|¬«      \  }}t        ||t        j
                  d¬«      \  }}	}t        ||«       t        ||«       t        ||«       t        ||	«       y )Nr0   r   r!   rN   )r   r   r   r$   rÃ   r0   r   )
r&   r   r   rP   r(   r)   rQ   r+   Úsum3Úedges3s
             r   Útest_dd_sumzTestBinnedStatistic.test_dd_sumq  s„   € Ø�F‰FˆØ�F‰Fˆä.¨q°!°UÀÔCÑˆˆf�bÜ—~‘~ a¨a¸Ô;‰ˆˆfÜ.¨q°!´R·V±VÀ!ÔDÑˆˆf�bä˜˜dÔ#Ü˜ Ô'Ü˜˜dÔ#Ü˜ Õ'r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )Nr.   r   r!   )r   r   r   r$   r.   r   ©r&   r   r   r8   r(   r)   r9   r+   s           r   Útest_dd_meanz TestBinnedStatistic.test_dd_mean~  sZ   € Ø�F‰FˆØ�F‰Fˆä/°°1°fÀ1ÔEÑˆˆv�rÜ/°°1´b·g±gÀAÔFÑˆˆv�rä˜˜uÔ%Ü˜ Õ'r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )Nr6   r   r!   )r   r   r   r$   r6   r   rÌ   s           r   Útest_dd_stdzTestBinnedStatistic.test_dd_stdˆ  óZ   € Ø�F‰FˆØ�F‰Fˆä/°°1°eÀ!ÔDÑˆˆv�rÜ/°°1´b·f±fÀ1ÔEÑˆˆv�rä˜˜uÔ%Ü˜ Õ'r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )NrZ   r   r!   )r   r   r   r$   rZ   r   rÌ   s           r   Útest_dd_minzTestBinnedStatistic.test_dd_min’  rÐ   r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )Nr]   r   r!   )r   r   r   r$   r]   r   rÌ   s           r   Útest_dd_maxzTestBinnedStatistic.test_dd_maxœ  rÐ   r   c                 óÌ   — | j                   }| j                  }t        ||dd¬«      \  }}}t        ||t        j                  d¬«      \  }}}t        ||«       t        ||«       y )Nr/   r   r!   )r   r   r   r$   r/   r   rÌ   s           r   Útest_dd_medianz"TestBinnedStatistic.test_dd_median¦  sZ   € Ø�F‰FˆØ�F‰Fˆä/°°1°hÀQÔGÑˆˆv�rÜ/°°1´b·i±iÀaÔHÑˆˆv�rä˜˜uÔ%Ü˜ Õ'r   c                 óZ  — | j                   d d }| j                  d d }t        ||dd¬«      \  }}}t        j                  g d¢«      }t        j
                  |«      D �cg c]  }||k(  j                  «       ‘Œ }}t        ||«       ||j                  «          }	t        ||	«       y c c}w )Nrb   r   r   r!   )é?   é!   éV   éS   éX   éC   é9   rÙ   é*   é)   éR   rÛ   é\   é    é$   é[   é+   éW   éQ   rè   )	r   r   r   r$   rd   re   r0   r   r©   )
r&   r   r   r'   r(   r)   rf   rg   rh   rª   s
             r   Útest_dd_bincodez#TestBinnedStatistic.test_dd_bincode°  s›   € Ø�F‰F�3�BˆKˆØ�F‰F�3�BˆKˆä0°°A°wÀQÔGÑˆ�˜Ü�h‰hò 4ó 5ˆô ,.¯9©9°R«=Ö9 a�2˜‘7—-‘-•/Ð9ˆÐ9ä˜˜CÔ Ø˜6Ÿ>™>Ó+Ñ,ˆ	Ü˜ 	Õ*ùò	 :s   Á B(c                 ó€  — | j                   }| j                  }| j                  }dddddddt        j                  fD ]  }t        |||d¬	«      \  }}}t        |||d¬	«      \  }}	}
t        |||g|d¬	«      \  }}}t        |d
   |«       t        |d   |«       t        ||«       t        |	|«       t        ||«       Œ� y )Nr   r0   r.   r6   rZ   r]   r/   r¨   r!   r   r	   )r   r   r   r$   r6   r   r   )r&   r   r   r   r¸   r{   r|   r}   r~   r   r€   r9   r+   rf   s                 r   Útest_dd_multi_valuesz(TestBinnedStatistic.test_dd_multi_values¾  sÇ   € Ø�F‰FˆØ�F‰FˆØ�F‰Fˆà˜e V¨U°E¸5À(Ü—V‘Vðò 		'ˆDä$7¸¸1¸dÈÔ$KÑ!ˆF�G˜TÜ$7¸¸1¸dÈÔ$KÑ!ˆF�G˜TÜ!4°Q¸¸A¸ÀÈ1Ô!MÑˆE�6˜3Ü˜E !™H fÔ-Ü˜E !™H fÔ-Ü˜G VÔ,Ü˜G VÔ,Ü˜D #Õ&ñ		'r   c                 óR  — | j                   }| j                  }t        |d d …df   |dd¬«      \  }}}t        |d d …df   |dd¬«      \  }}}t        |d d …df   |dd¬«      \  }}}	t        ||dd	d
¬«      \  }
}}t	        ||d   «       t	        ||d   «       t	        |	|d   «       y )Nr   r.   rl   r!   r	   rb   rc   r    )rl   rb   r    Tr³   )r   r   r   r   r   )r&   r   r   r¸   r¹   rº   r»   r¼   ÚedgeszÚbczr9   r+   rf   s                r   Útest_dd_binnumbers_unraveledz0TestBinnedStatistic.test_dd_binnumbers_unraveledÎ  sº   € Ø�F‰FˆØ�F‰Fˆä,¨Qªq°!¨t©W°a¸ÀbÔIÑˆˆf�cÜ,¨Qªq°!¨t©W°a¸ÀbÔIÑˆˆf�cÜ,¨Qªq°!¨t©W°a¸ÀbÔIÑˆˆf�cä0Øˆq�&˜|¸tôEÑˆˆv�sô 	˜˜S ™VÔ$Ü˜˜S ™VÔ$Ü˜˜S ™VÕ$r   c                 óB  — t         j                  j                  d«      }|j                  d«      }|j                  d«      }t        j                  ddd«      }|||f}t	        ||d|¬«      }|j
                  }t	        ||d|¬	«      }|j
                  }t        ||«       y )
Nl   g
óF ©é'  r   rò   r   r	   r    r.   r!   )Úbinned_statistic_result)r$   rp   rq   Úlinspacer   r2   r   )r&   r   r   r   r"   Úresultr¸   r9   s           r   Útest_dd_binned_statistic_resultz3TestBinnedStatistic.test_dd_binned_statistic_resultÝ  s”   € ä�i‰i×#Ñ# JÓ/ˆØ�J‰J�zÓ"ˆØ�J‰J�uÓˆÜ�{‰{˜1˜a Ó$ˆØ�d˜DÐ!ˆä$ Q¨¨6¸Ô=ˆØ×Ñˆä$ Q¨¨6Ø=CôEˆà× Ñ ˆä˜˜eÕ$r   c                 óT  — t         j                  j                  d«      }|j                  d«      }|j                  d«      }t        j                  ddd«      }t        j                  |d«      }|||f}t        t        d¬«      5  t        ||d	|¬
«       d d d «       y # 1 sw Y   y xY w)NiÍÿƒCrñ   rò   r   r	   r    zdifference is numerically 0©Úmatchr.   r!   )r$   rp   rq   rô   ÚappendrA   rB   r   )r&   r   r   r   r"   s        r   Útest_dd_zero_dedgesz'TestBinnedStatistic.test_dd_zero_dedgesî  sŽ   € Ü�i‰i×#Ñ# JÓ/ˆØ�J‰J�zÓ"ˆØ�J‰J�uÓˆÜ�{‰{˜1˜a Ó$ˆÜ�y‰y˜˜qÓ!ˆØ�d˜DÐ!ˆÜœ:Ð-JÔKñ 	9Ü  1 f°4Õ8÷	9÷ 	9ñ 	9ús   ÂBÂB'c                 ó²  — t        t        d¬«      5  t        | j                  g| j                  ddgg¬«       d d d «       t        t        d¬«      5  t        | j
                  | j                  g| j                  ddgddgg¬«       d d d «       t        t        d¬«      5  t        | j
                  | j                  g| j                  ddgddgg¬«       d d d «       t        t        d¬«      5  t        | j
                  | j                  g| j                  ddgg¬«       d d d «       y # 1 sw Y   ŒñxY w# 1 sw Y   Œ¯xY w# 1 sw Y   ŒmxY w# 1 sw Y   y xY w)	NzIn range, start must be <= stoprø   r	   r   rn   z.In dimension 1 of range, start must be <= stopz.In dimension 2 of range, start must be <= stopz(range given for 1 dimensions; 2 required)rA   rB   r   r   r   r   )r&   s    r   Útest_dd_range_errorsz(TestBinnedStatistic.test_dd_range_errorsø  sC  € ô œ:Ø!BôDñ 	0ä §¡ ¨$¯&©&Ø()¨1 v hõ0÷	0ô ÜØFôHñ 	8ô   §¡¨¯©Ð 0°$·&±&Ø()¨1 v°°1¨vÐ&6õ8÷	8ô
 ÜØFôHñ 	8ô   §¡¨¯©Ð 0°$·&±&Ø()¨1 v°°1¨vÐ&6õ8÷	8ô
 ÜØ@ôBñ 	0ô   §¡¨¯©Ð 0°$·&±&Ø()¨1 v hõ0÷	0ð 	0÷	0ð 	0ú÷	8ð 	8ú÷
	8ð 	8ú÷
	0ð 	0ús/   ’'D)Á5D5Â 5EÃ.2EÄ)D2Ä5D>ÅE
ÅEc                 óÚ   — t        j                  ddgt         j                  ¬«      }t        |d dd¬«      \  }}}t	        |t        j                  g d¢t         j
                  ¬«      «       y )Nr   gÂhwÄøÛ?)Údtyper   rƒ   r!   )r	   r   r   r   r	   )r$   rd   Úfloat32r   r   Úfloat64)r&   r   r¸   rt   s       r   Útest_binned_statistic_float32z1TestBinnedStatistic.test_binned_statistic_float32  sI   € Ü�H‰H�a˜�_¬B¯J©JÔ7ˆÜ% a¨¨w¸QÔ?‰
ˆˆa�Ü˜œbŸh™h¢¼b¿j¹jÔIÕJr   c                 ó<  — g }d}t        |«      D ]  }|dd|z  z
  gz  }Œ t        j                  ddd«      }t        |t        j                  t        |«      «      |gd¬«      \  }}}t        j                  ||¬«      \  }}	t        ||«       t        |d   |	«       y )	Nrb   r	   gš™™™™™¹?r   r£   r0   )r"   r2   r!   )ro   r$   rô   r   ÚonesÚlenr%   r   )
r&   r   r   rg   r"   rP   r(   r)   rQ   r+   s
             r   Útest_gh14332z TestBinnedStatistic.test_gh14332  s›   € àˆØˆÜ�t“ò 	ˆAØ�!�C˜‘F‘(�‰O‰Að	ô �{‰{˜1˜Q˜rÓ"ˆÜ.¨q´"·'±'¼#¸a»&³/Ø59°FÀeôMÑˆˆf�bä—|‘| A¨DÔ1‰ˆˆfä˜˜dÔ#Ü˜˜q™	 6Õ*r   rÿ   r2   r   c                 ó(   — | dz  j                  «       S )Nrc   ©r0   ©r   s    r   ú<lambda>zTestBinnedStatistic.<lambda>&  s   € °a¸±d·Z±Z³\€ r   c                 ó.   — | dz  j                  «       dz  S )Nrc   ù              ð?r  r	  s    r   r
  zTestBinnedStatistic.<lambda>'  s   € °a¸±d·Z±Z³\ÀBÑ5F€ r   c                 ó  ‡— ˆfd„}t         j                  j                  d«      }d}|j                  |¬«      }|dk\  }|j                  |¬«      }|t         j                  u r||j                  |¬«      dz  z   }t	        ||‰d¬«      \  }	}
}
t        j
                   |||    «       |||   «      g«      }t        |	|«       |	j                  t        j                  |j                  t         j                  «      k(  sJ ‚y )	Nc                 ó4   •— ‰dk(  rt        | «      S  ‰| «      S )Nr   )r  )r   r2   s    €r   Úref_statisticz6TestBinnedStatistic.test_dd_all.<locals>.ref_statistic)  s   ø€ Ø&¨'Ò1”3�q“6ÐC±yÀ³|ÐCr   l   #tÆ%i r    r   g      à?r  rc   r!   )
r$   rp   rq   Ú
complex128r   rd   r   rÿ   Úresult_typer  )r&   rÿ   r2   r  r   Únr   rg   r   r¸   rt   Úrefs     `         r   Útest_dd_allzTestBinnedStatistic.test_dd_all#  sà   ø€ ô	Dô �i‰i×#Ñ#Ð$4Ó5ˆØˆØ�J‰J˜AˆJÓˆØ�‰HˆØ�J‰J˜AˆJÓˆØ”B—M‘MÑ!Ø�C—J‘J A�JÓ& rÑ)Ñ)ˆAä(¨¨A¨y¸qÔA‰
ˆˆa�Ü�h‰h™ a¨¨¡eÓ,©m¸A¸a¹DÓ.AÐBÓCˆÜ˜˜cÔ"Ø�z‰zœRŸ^™^¨C¯I©I´r·z±zÓBÒBÐBÑBr   N)=Ú__name__Ú
__module__Ú__qualname__Úclassmethodr   r,   r3   r:   r=   rE   rL   rR   rU   rW   r[   r^   r`   ri   ry   r�   rŠ   rŽ   r�   r•   r—   r™   rœ   rž   r    r«   r±   rÁ   rÄ   rÆ   rÊ   rÍ   rÏ   rÒ   rÔ   rÖ   ré   rë   rï   rö   rû   rý   r  r  ÚpytestÚmarkÚparametrizer$   r  r  r.   r/   r0   r6   rZ   r]   r  © r   r   r   r      sp  „ àñ,ó ð,ò(ò7ò&ò&òLò-ò(ò(ò(ò(ò(ò(ò(ò+ò#ò&ò-ò
&ò
&ò	&ò
&ò
&ò
&ò&ò+ò #ò&&ò.(ò-ò(ò(ò(ò(ò(ò(ò+ò'ò %ò%ò"9ò0ò.Kò
+ð ‡[�[×Ñ˜W r§z¡z°2·=±=Ð&AÓBØ‡[�[×Ñ˜[¨2¯7©7°B·I±I¸r¿v¹vÀrÇvÁvØ+-¯6©6°2·6±6¸7Ù+AÙ+Fð+Hó IñCó	Ió Cñ
Cr   r   )Únumpyr$   Únumpy.testingr   r  r   rA   Úscipy.statsr   r   r   Úscipy._lib._utilr   Úcommon_testsr
   r   r  r   r   ú<module>r"     s/   ðÛ Ý )Û Ý *÷.ñ .å /å -÷kCò kCr   