@@ -216,6 +216,7 @@ def test_x_cols_setter_defaults():
216
216
df = pd .DataFrame (np .tile (np .arange (6 ), (4 , 1 )),
217
217
columns = ['yy' , 'dd' , 'xx1' , 'xx2' , 'zz' , 'tt' ])
218
218
dml_data = DoubleMLData (df , y_col = 'yy' , d_cols = 'dd' , z_cols = 'zz' , t_col = 'tt' )
219
+ assert dml_data .x_cols == ['xx1' , 'xx2' ]
219
220
220
221
# without instrument with selection
221
222
df = pd .DataFrame (np .tile (np .arange (5 ), (4 , 1 )),
@@ -226,7 +227,19 @@ def test_x_cols_setter_defaults():
226
227
# with instrument with selection
227
228
df = pd .DataFrame (np .tile (np .arange (6 ), (4 , 1 )),
228
229
columns = ['yy' , 'dd' , 'xx1' , 'xx2' , 'zz' , 'ss' ])
229
- dml_data = DoubleMLData (df , y_col = 'yy' , d_cols = 'dd' , z_cols = 'zz' , t_col = 'ss' )
230
+ dml_data = DoubleMLData (df , y_col = 'yy' , d_cols = 'dd' , z_cols = 'zz' , s_col = 'ss' )
231
+ assert dml_data .x_cols == ['xx1' , 'xx2' ]
232
+
233
+ # with selection and time
234
+ df = pd .DataFrame (np .tile (np .arange (6 ), (4 , 1 )),
235
+ columns = ['yy' , 'dd' , 'xx1' , 'xx2' , 'tt' , 'ss' ])
236
+ dml_data = DoubleMLData (df , y_col = 'yy' , d_cols = 'dd' , t_col = 'tt' , s_col = 'ss' )
237
+ assert dml_data .x_cols == ['xx1' , 'xx2' ]
238
+
239
+ # with instrument, selection and time
240
+ df = pd .DataFrame (np .tile (np .arange (7 ), (4 , 1 )),
241
+ columns = ['yy' , 'dd' , 'xx1' , 'xx2' , 'zz' , 'tt' , 'ss' ])
242
+ dml_data = DoubleMLData (df , y_col = 'yy' , d_cols = 'dd' , z_cols = 'zz' , t_col = 'tt' , s_col = 'ss' )
230
243
assert dml_data .x_cols == ['xx1' , 'xx2' ]
231
244
232
245
0 commit comments