def test_weight_mat(self, simulated):
res, stata = simulated
if not hasattr(stata, "weight_mat") or not isinstance(stata.weight_mat, pd.DataFrame):
pytest.skip("Comparison result not available")
stata_weight_mat = stata.weight_mat.reindex_like(res.weight_matrix)
stata_weight_mat = stata_weight_mat[res.weight_matrix.columns]
assert_allclose(res.weight_matrix, stata_weight_mat, rtol=1e-4)
After Change
def test_weight_mat(self, simulated):
res, stata = simulated
if not hasattr(stata, "weight_mat") or not isinstance(stata.weight_mat, pd.DataFrame):
return
stata_weight_mat = stata.weight_mat.reindex_like(res.weight_matrix)
stata_weight_mat = stata_weight_mat[res.weight_matrix.columns]
assert_allclose(res.weight_matrix, stata_weight_mat, rtol=1e-4)