#NEWLINE# def test_loading_and_storing_empty_containers( self ) : #NEWLINE# #INDENT# filename = make_temp_dir ( 'empty_containers.hdf5' ) #NEWLINE# traj = Trajectory ( filename = filename , add_time = True ) #NEWLINE# traj . f_add_parameter ( ArrayParameter , 'empty.tuple' , ( ) ) #NEWLINE# traj . f_add_parameter ( ArrayParameter , 'empty.array' , np . array ( [ ] , dtype = float ) ) #NEWLINE# spsparse_csc = spsp . csc_matrix ( ( 2 , 10 ) ) #NEWLINE# spsparse_csr = spsp . csr_matrix ( ( 6660 , 660 ) ) #NEWLINE# spsparse_bsr = spsp . bsr_matrix ( ( 3330 , 2220 ) ) #NEWLINE# spsparse_dia = spsp . dia_matrix ( ( 1230 , 1230 ) ) #NEWLINE# traj . f_add_parameter ( SparseParameter , 'empty.csc' , spsparse_csc ) #NEWLINE# traj . f_add_parameter ( SparseParameter , 'empty.csr' , spsparse_csr ) #NEWLINE# traj . f_add_parameter ( SparseParameter , 'empty.bsr' , spsparse_bsr ) #NEWLINE# traj . f_add_parameter ( SparseParameter , 'empty.dia' , spsparse_dia ) #NEWLINE# traj . f_add_result ( SparseResult , 'empty.all' , dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , list = [ ] , series = pd . Series ( ) , frame = pd . DataFrame ( ) , panel = pd . Panel ( ) , ** traj . par . f_to_dict ( short_names = True , fast_access = True ) ) #NEWLINE# traj . f_store ( ) #NEWLINE# newtraj = load_trajectory ( index = ( - 1 ) , filename = filename ) #NEWLINE# newtraj . f_load ( load_data = 2 ) #NEWLINE# epg = newtraj . par . empty #NEWLINE# self . assertTrue ( ( type ( epg . tuple ) is tuple ) ) #NEWLINE# self . assertTrue ( ( len ( epg . tuple ) == 0 ) ) #NEWLINE# self . assertTrue ( ( type ( traj . array ) is np . ndarray ) ) #NEWLINE# self . assertTrue ( ( epg . array . size == 0 ) ) #NEWLINE# self . assertTrue ( spsp . isspmatrix_csr ( epg . csr ) ) #NEWLINE# self . assertTrue ( ( epg . csr . size == 0 ) ) #NEWLINE# self . assertTrue ( spsp . isspmatrix_csc ( epg . csc ) ) #NEWLINE# self . assertTrue ( ( epg . csc . size == 0 ) ) #NEWLINE# self . assertTrue ( spsp . isspmatrix_bsr ( epg . bsr ) ) #NEWLINE# self . assertTrue ( ( epg . bsr . size == 0 ) ) #NEWLINE# self . assertTrue ( spsp . isspmatrix_dia ( epg . dia ) ) #NEWLINE# self . assertTrue ( ( epg . dia . size == 0 ) ) #NEWLINE# self . compare_trajectories ( traj , newtraj )