def _assert_reorder(cov_new, cov_orig, order):
 inv_order = np.argsort(order)
 assert_array_equal([cov_new['names'][ii] for ii in inv_order], cov_orig['names'])
 assert_allclose(cov_new['data'][inv_order][:, inv_order], cov_orig['data'], atol=1e-20)

def _assert_reorder ( cov_new , cov_orig , order ) : inv_order = np . argsort ( order ) assert_array_equal ( [ cov_new [ 'names' ] [ ii ] for ii in inv_order ] , cov_orig [ 'names' ] ) assert_allclose ( cov_new [ 'data' ] [ inv_order ] [ : , inv_order ] , cov_orig [ 'data' ] , atol = 1e-20 )
check that we get the same result under reordering .