a :jg @s2ddlZddlmZmZmZmZGdddZdS)N)assert_assert_array_equalassert_allclosesuppress_warningsc@s|eZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZdS)TestRegressioncCs4tjjgdgdd}ttj|gdgdS)N)rr)rrrrrrrrmask)rrr )npma masked_arrayrZnonzero)selfxrH/usr/local/lib/python3.9/site-packages/numpy/ma/tests/test_regression.pytest_masked_array_creates z'TestRegression.test_masked_array_createcCstjjddgddS)Nrr )rrarrayrrrrtest_masked_arraysz TestRegression.test_masked_arraycCs>ddlm}m}td}t|j|}|||}||dS)Nr) masked_whereMaskType)rr)Znumpy.marrrzerosshape)rrrabcrrrtest_mem_masked_wheres   z$TestRegression.test_mem_masked_wherecCs6tjd}tjj|d<td}||||dS)N)r r)rr)r r)rrrZmaskedrrr rrrtest_masked_array_multiplys    z)TestRegression.test_masked_array_multiplycCstjjdgddddS)NrFr )rrrrepeatrrrrtest_masked_array_repeat"sz'TestRegression.test_masked_array_repeatcCsttjddS)NZUnicode)reprrrrrrrrtest_masked_array_repr_unicode&sz-TestRegression.test_masked_array_repr_unicodecCsFtjjgdgdd}t|}t|jjdkt|jjdkdS)N)gg333333?g @)FTFr rr)rrrZ atleast_2drrndimr#rrrtest_atleast_2d*s zTestRegression.test_atleast_2dcCs0tjjgdgdd}d|_t|jdkdS)N)rr r!)rrrr X)rrrZ fill_valuer)rrrrrtest_set_fill_value_unicode_py31sz.TestRegression.test_set_fill_value_unicode_py3cCsDtjjtddd}tjjdtd}|j|dt|jdkdS)Nr Tr Zdtype)outr)rrrarangefloatvarr_data)rrZmoutrrr test_var_sets_maskedarray_scalar7s z/TestRegression.test_var_sets_maskedarray_scalarcCstjgdd}tgd}tN}|tdtjj||dd}tjj||dd}t|j |j Wdn1sz0YdS)N)rrr r r r )rg@g@r r zbias and ddof have no effectr)Zddofr) rrZ masked_equalrrfilterDeprecationWarningZcorrcoefrdata)rrysupZr0r1rrrtest_ddof_corrcoef>s z!TestRegression.test_ddof_corrcoefcCsftjjddgddgd}t|jjdkt|d}t|jjdkt|jdkt|jjdkdS)N?@Fr )r)rrrr)rr MaskedArrayrrrZtiler#rrrtest_mask_not_backmangledJs  z(TestRegression.test_mask_not_backmangledcCs.tjjgddd}t|g|dddS)N))rr=)rr>)r g@zi4,f4r/r)rrr@rrrrrrtest_empty_list_on_structuredTsz,TestRegression.test_empty_list_on_structuredcCs.tjdd}t|jdd|jdS)Nr r?F)order)rrr1ZreshapertobytesTrBrrr!test_masked_array_tobytes_fortranYsz0TestRegression.test_masked_array_tobytes_fortrancCs2tjjddtjfddtjfdtjfgfgddS)N)r)rIrr9ijr/)rrrint_voidrrrrtest_structured_array]s z$TestRegression.test_structured_arrayN)__name__ __module__ __qualname__rrr"r$r'r)r+r-r5r<rArCrHrNrrrrrs  r)numpyrZ numpy.testingrrrrrrrrrs