@testing.requires_testing_data
def test_subject_info():
 tempdir = _TempDir()
 raw = read_raw_fif(fif_fname).crop(0, 1)
 assert_true((raw.info['subject_info'] is None))
 keys = ['id', 'his_id', 'last_name', 'first_name', 'birthday', 'sex', 'hand']
 vals = [1, 'foobar', 'bar', 'foo', (1901, 2, 3), 0, 1]
 subject_info = dict()
 for (key, val) in zip(keys, vals):
  subject_info[key] = val
 raw.info['subject_info'] = subject_info
 out_fname = op.join(tempdir, 'test_subj_info_raw.fif')
 raw.save(out_fname, overwrite=True)
 raw_read = read_raw_fif(out_fname)
 for key in keys:
  assert_equal(subject_info[key], raw_read.info['subject_info'][key])
 assert_equal(raw.info['meas_date'], raw_read.info['meas_date'])

@ testing . requires_testing_data def test_subject_info ( ) : tempdir = _TempDir ( ) raw = read_raw_fif ( fif_fname ) . crop ( 0 , 1 ) assert_true ( ( raw . info [ 'subject_info' ] is None ) ) keys = [ 'id' , 'his_id' , 'last_name' , 'first_name' , 'birthday' , 'sex' , 'hand' ] vals = [ 1 , 'foobar' , 'bar' , 'foo' , ( 1901 , 2 , 3 ) , 0 , 1 ] subject_info = dict ( ) for ( key , val ) in zip ( keys , vals ) : subject_info [ key ] = val raw . info [ 'subject_info' ] = subject_info out_fname = op . join ( tempdir , 'test_subj_info_raw.fif' ) raw . save ( out_fname , overwrite = True ) raw_read = read_raw_fif ( out_fname ) for key in keys : assert_equal ( subject_info [ key ] , raw_read . info [ 'subject_info' ] [ key ] ) assert_equal ( raw . info [ 'meas_date' ] , raw_read . info [ 'meas_date' ] )
test reading subject information .