#NEWLINE# def create_param_dict( param_dict ) : #NEWLINE# #INDENT# 'Fills a dictionary with some parameters that can be put into a trajectory.\n    ' #NEWLINE# param_dict [ 'Normal' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# param_dict [ 'Numpy' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# param_dict [ 'Sparse' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# param_dict [ 'Numpy_2D' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# param_dict [ 'Numpy_3D' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# param_dict [ 'Tuples' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# param_dict [ 'Lists' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# param_dict [ 'Pickle' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# normal_dict = param_dict [ 'Normal' ] #NEWLINE# normal_dict [ 'string' ] = 'Im a test string!' #NEWLINE# normal_dict [ 'int' ] = 42 #NEWLINE# normal_dict [ 'long' ] = compat . long_type ( 42 ) #NEWLINE# normal_dict [ 'double' ] = 42.42 #NEWLINE# normal_dict [ 'bool' ] = True #NEWLINE# normal_dict [ 'trial' ] = 0 #NEWLINE# numpy_dict = param_dict [ 'Numpy' ] #NEWLINE# numpy_dict [ 'string' ] = np . array ( [ 'Uno' , 'Dos' , 'Tres' ] ) #NEWLINE# numpy_dict [ 'int' ] = np . array ( [ 1 , 2 , 3 , 4 ] ) #NEWLINE# numpy_dict [ 'double' ] = np . array ( [ 1.0 , 2.0 , 3.0 , 4.0 ] ) #NEWLINE# numpy_dict [ 'bool' ] = np . array ( [ True , False , True ] ) #NEWLINE# param_dict [ 'Numpy_2D' ] [ 'double' ] = np . matrix ( [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] ) #NEWLINE# param_dict [ 'Numpy_3D' ] [ 'double' ] = np . array ( [ [ [ 1.0 , 2.0 ] , [ 3.0 , 4.0 ] ] , [ [ 3.0 , ( - 3.0 ) ] , [ 42.0 , 41.0 ] ] ] ) #NEWLINE# spsparse_csc = spsp . lil_matrix ( ( 222 , 22 ) ) #NEWLINE# spsparse_csc [ ( 1 , 2 ) ] = 44.6 #NEWLINE# spsparse_csc [ ( 1 , 9 ) ] = 44.5 #NEWLINE# spsparse_csc = spsparse_csc . tocsc ( ) #NEWLINE# spsparse_csr = spsp . lil_matrix ( ( 222 , 22 ) ) #NEWLINE# spsparse_csr [ ( 1 , 3 ) ] = 44.7 #NEWLINE# spsparse_csr [ ( 17 , 17 ) ] = 44.755555 #NEWLINE# spsparse_csr = spsparse_csr . tocsr ( ) #NEWLINE# spsparse_bsr = spsp . bsr_matrix ( np . matrix ( [ [ 1 , 1 , 0 , 0 , 2 , 2 ] , [ 1 , 1 , 0 , 0 , 2 , 2 ] , [ 0 , 0 , 0 , 0 , 3 , 3 ] , [ 0 , 0 , 0 , 0 , 3 , 3 ] , [ 4 , 4 , 5 , 5 , 6 , 6 ] , [ 4 , 4 , 5 , 5 , 6 , 6 ] ] ) ) #NEWLINE# spsparse_dia = spsp . dia_matrix ( np . matrix ( [ [ 1 , 0 , 3 , 0 ] , [ 1 , 2 , 0 , 4 ] , [ 0 , 2 , 3 , 0 ] , [ 0 , 0 , 3 , 4 ] ] ) ) #NEWLINE# param_dict [ 'Sparse' ] [ 'bsr_mat' ] = spsparse_bsr #NEWLINE# param_dict [ 'Sparse' ] [ 'csc_mat' ] = spsparse_csc #NEWLINE# param_dict [ 'Sparse' ] [ 'csr_mat' ] = spsparse_csr #NEWLINE# param_dict [ 'Sparse' ] [ 'dia_mat' ] = spsparse_dia #NEWLINE# param_dict [ 'Tuples' ] [ 'empty' ] = ( ) #NEWLINE# param_dict [ 'Tuples' ] [ 'int' ] = ( 1 , 2 , 3 ) #NEWLINE# param_dict [ 'Tuples' ] [ 'float' ] = ( 44.4 , 42.1 , 3.0 ) #NEWLINE# param_dict [ 'Tuples' ] [ 'str' ] = ( '1' , '2wei' , 'dr3i' ) #NEWLINE# param_dict [ 'Lists' ] [ 'lempty' ] = [ ] #NEWLINE# param_dict [ 'Lists' ] [ 'lint' ] = [ 1 , 2 , 3 ] #NEWLINE# param_dict [ 'Lists' ] [ 'lfloat' ] = [ 44.4 , 42.1 , 3.0 ] #NEWLINE# param_dict [ 'Lists' ] [ 'lstr' ] = [ '1' , '2wei' , 'dr3i' ] #NEWLINE# param_dict [ 'Pickle' ] [ 'list' ] = [ 'b' , 'h' , 53 , ( ) , 0 ] #NEWLINE# param_dict [ 'Pickle' ] [ 'list' ] = [ 'b' , 'h' , 42 , ( ) , 1 ] #NEWLINE# param_dict [ 'Pickle' ] [ 'list' ] = [ 'b' , [ 444 , 43 ] , 44 , ( ) , 2 ]