@@ -57,35 +57,27 @@ def test_run_variable_collection_to_df(run_coll):
5757
5858 # All variables sparse, wide format
5959 df = run_coll .to_df ()
60- assert df .shape == (4096 , 13 )
60+ assert df .shape == (4096 , 15 )
6161 wide_cols = {'onset' , 'duration' , 'subject' , 'run' , 'task' ,
6262 'PTval' , 'RT' , 'gain' , 'loss' , 'parametric gain' , 'respcat' ,
63- 'respnum' , 'trial_type' }
63+ 'respnum' , 'trial_type' , 'suffix' , 'datatype' }
6464 assert set (df .columns ) == wide_cols
6565
6666 # All variables sparse, wide format
6767 df = run_coll .to_df (format = 'long' )
68- assert df .shape == (32768 , 7 )
68+ assert df .shape == (32768 , 9 )
6969 long_cols = {'amplitude' , 'duration' , 'onset' , 'condition' , 'run' ,
70- 'task' , 'subject' }
70+ 'task' , 'subject' , 'suffix' , 'datatype' }
7171 assert set (df .columns ) == long_cols
7272
7373 # All variables dense, wide format
7474 df = run_coll .to_df (sparse = False )
7575 assert df .shape == (230400 , 14 )
76- # The inclusion of 'modality' and 'type' here is a minor bug that should
77- # be fixed at some point. There is no reason why to_df() should return
78- # more columns for a DenseRunVariable than a SparseRunVariable, but this
79- # is happening because these columns are not included in the original
80- # SparseRunVariable data, and are being rebuilt from the entity list in
81- # the DenseRunVariable init.
82- wide_cols |= {'datatype' , 'suffix' }
8376 assert set (df .columns ) == wide_cols - {'trial_type' }
8477
8578 # All variables dense, wide format
8679 df = run_coll .to_df (sparse = False , format = 'long' )
8780 assert df .shape == (1612800 , 9 )
88- long_cols |= {'datatype' , 'suffix' }
8981 assert set (df .columns ) == long_cols
9082
9183
@@ -100,14 +92,14 @@ def test_merge_collections(run_coll, run_coll_list):
10092def test_get_collection_entities (run_coll_list ):
10193 coll = run_coll_list [0 ]
10294 ents = coll .entities
103- assert {'run' , 'task' , 'subject' } == set (ents .keys ())
95+ assert {'run' , 'task' , 'subject' , 'suffix' , 'datatype' } == set (ents .keys ())
10496
10597 merged = merge_collections (run_coll_list [:3 ])
10698 ents = merged .entities
107- assert {'task' , 'subject' } == set (ents .keys ())
99+ assert {'task' , 'subject' , 'suffix' , 'datatype' } == set (ents .keys ())
108100 assert ents ['subject' ] == '01'
109101
110102 merged = merge_collections (run_coll_list [3 :6 ])
111103 ents = merged .entities
112- assert {'task' , 'subject' } == set (ents .keys ())
104+ assert {'task' , 'subject' , 'suffix' , 'datatype' } == set (ents .keys ())
113105 assert ents ['subject' ] == '02'
0 commit comments