#NEWLINE# def test_max_depth_loading_and_storing( self ) : #NEWLINE# #INDENT# filename = make_temp_dir ( 'newassignment.hdf5' ) #NEWLINE# traj = Trajectory ( filename = filename , overwrite_file = True ) #NEWLINE# traj . par . d1 = Parameter ( 'd1.d2.d3.d4.d5' , 55 ) #NEWLINE# traj . f_store ( max_depth = 4 ) #NEWLINE# traj = load_trajectory ( index = ( - 1 ) , filename = filename ) #NEWLINE# traj . f_load ( load_data = 2 ) #NEWLINE# self . assertTrue ( ( 'd3' in traj ) ) #NEWLINE# self . assertFalse ( ( 'd4' in traj ) ) #NEWLINE# traj = load_trajectory ( index = ( - 1 ) , filename = filename , max_depth = 3 ) #NEWLINE# self . assertTrue ( ( 'd2' in traj ) ) #NEWLINE# self . assertFalse ( ( 'd3' in traj ) ) #NEWLINE# traj . par . f_remove ( recursive = True ) #NEWLINE# traj . dpar . d1 = Parameter ( 'd1.d2.d3.d4.d5' , 123 ) #NEWLINE# traj . dpar . f_store_child ( 'd1' , recursive = True , max_depth = 3 ) #NEWLINE# traj . dpar . f_remove_child ( 'd1' , recursive = True ) #NEWLINE# self . assertTrue ( ( 'd1' not in traj ) ) #NEWLINE# traj . dpar . f_load_child ( 'd1' , recursive = True ) #NEWLINE# self . assertTrue ( ( 'd3' in traj ) ) #NEWLINE# self . assertTrue ( ( 'd4' not in traj ) ) #NEWLINE# traj . dpar . f_remove_child ( 'd1' , recursive = True ) #NEWLINE# self . assertTrue ( ( 'd1' not in traj ) ) #NEWLINE# traj . dpar . f_load_child ( 'd1' , recursive = True , max_depth = 2 ) #NEWLINE# self . assertTrue ( ( 'd2' in traj ) ) #NEWLINE# self . assertTrue ( ( 'd3' not in traj ) ) #NEWLINE# traj . dpar . l1 = Parameter ( 'l1.l2.l3.l4.l5' , 123 ) #NEWLINE# traj . dpar . f_store ( recursive = True , max_depth = 0 ) #NEWLINE# self . assertFalse ( traj . dpar . l1 . _stored ) #NEWLINE# traj . dpar . f_store ( recursive = True , max_depth = 4 ) #NEWLINE# traj . dpar . f_remove ( ) #NEWLINE# self . assertTrue ( ( 'l1' not in traj ) ) #NEWLINE# traj . dpar . f_load ( recursive = True ) #NEWLINE# self . assertTrue ( ( 'l4' in traj ) ) #NEWLINE# self . assertTrue ( ( 'l5' not in traj ) ) #NEWLINE# traj . dpar . f_remove ( ) #NEWLINE# self . assertTrue ( ( 'l1' not in traj ) ) #NEWLINE# traj . dpar . f_load ( recursive = True , max_depth = 3 ) #NEWLINE# self . assertTrue ( ( 'l3' in traj ) ) #NEWLINE# self . assertTrue ( ( 'l4' not in traj ) )