From 0edf9f8ea37f36ca87a4ad1912f0266636773a6f Mon Sep 17 00:00:00 2001 From: le-ander <20015434+le-ander@users.noreply.github.com> Date: Thu, 15 Jul 2021 14:47:47 +0200 Subject: [PATCH] fix extraction of corf_loc_names when dmat is provided directly --- diffxpy/testing/tests.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/diffxpy/testing/tests.py b/diffxpy/testing/tests.py index 035ec5d..f649179 100644 --- a/diffxpy/testing/tests.py +++ b/diffxpy/testing/tests.py @@ -698,7 +698,10 @@ def wald( as_numeric=as_numeric ) else: - coef_loc_names = dmat_loc.columns.tolist() + if isinstance(dmat_loc, patsy.design_info.DesignMatrix): + coef_loc_names = dmat_loc.design_info.column_names + else: + coef_loc_names = dmat_loc.columns.tolist() if not np.all([x in coef_loc_names for x in coef_to_test]): raise ValueError( "the requested test coefficients %s were found in model coefficients %s" %