Changeset 23689
- Timestamp:
- 02/04/19 12:50:23 (6 years ago)
- Location:
- issm/trunk-jpl/src/py3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/py3/archive/arch.py
r23677 r23689 1 1 import numpy as np 2 import math3 2 import struct 4 import sys 5 import os 3 from os import path 6 4 from collections import OrderedDict 7 5 … … 18 16 # open file 19 17 try: 20 if not os.path.isfile(filename):18 if not path.isfile(filename): 21 19 fid=open(filename,'wb') 22 20 else: … … 31 29 name=args[2*i] 32 30 write_field_name(fid,name) 33 31 34 32 # write data associated with field name 35 33 data=args[2*i+1] … … 43 41 else: 44 42 raise ValueError("archwrite : error writing data, invalid code entered '%d'" % code) 45 43 46 44 fid.close() 47 45 … … 55 53 """ 56 54 try: 57 if os.path.isfile(filename):55 if path.isfile(filename): 58 56 fid=open(filename,'rb') 59 57 else: … … 61 59 except IOError as e: 62 60 raise IOError("archread error : could not open file '%s' to read from" % filename) 63 61 64 62 archive_results=[] 65 63 66 64 # read first result 67 65 result=read_field(fid) 66 68 67 while result: 69 68 if fieldname == result['field_name']: … … 71 70 archive_results=result['data']; # we only want the data 72 71 break 73 72 74 73 # read next result 75 74 result=read_field(fid) 76 75 77 76 # close file 78 77 fid.close() 79 78 80 79 return archive_results 81 80 # }}} … … 88 87 """ 89 88 try: 90 if os.path.isfile(filename):89 if path.isfile(filename): 91 90 fid=open(filename,'rb') 92 91 else: … … 94 93 except IOError as e: 95 94 raise IOError("archread error : could not open file '%s' to read from" % filename) 96 95 97 96 print('Source file: ') 98 97 print('\t{0}'.format(filename)) … … 106 105 # go to next result 107 106 result=read_field(fid) 108 107 109 108 # close file 110 109 fid.close() … … 112 111 # }}} 113 112 114 # Helper functions 113 # Helper functions 115 114 def write_field_name(fid,data): # {{{ 116 115 """ … … 121 120 reclen=len(data)+4+4 122 121 fid.write(struct.pack('>i',reclen)) 123 122 124 123 # write format code 125 124 code=format_archive_code(data); … … 130 129 # write string length, and then the string 131 130 fid.write(struct.pack('>i',len(data))) 132 fid.write(struct.pack('> %ds' % len(data),data))131 fid.write(struct.pack('>{}s'.format(len(data)),data.encode('utf8'))) 133 132 # }}} 134 133 def write_scalar(fid,data): # {{{ … … 143 142 # write the format code (2 for scalar) 144 143 fid.write(struct.pack('>i',2)) 145 144 146 145 # write the double 147 146 fid.write(struct.pack('>d',data)) … … 158 157 elif isinstance(data,(list,tuple)): 159 158 data=np.array(data).reshape(-1,) 160 159 161 160 if np.ndim(data) == 1: 162 161 if np.size(data): … … 164 163 else: 165 164 data=data.reshape(0,0) 166 165 167 166 # get size of data 168 167 sz=data.shape … … 175 174 raise ValueError("archwrite error : can not write vector to binary file because it is too large") 176 175 fid.write(struct.pack('>i',reclen)) 177 176 178 177 # write format code 179 178 fid.write(struct.pack('>i',3)) … … 204 203 raise ValueError('archread error : a string was not present at the start of the arch file') 205 204 namelen=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0] 206 fieldname=struct.unpack('> %ds' % namelen,fid.read(namelen))[0]207 205 fieldname=struct.unpack('>{}s'.format(namelen),fid.read(namelen))[0] 206 208 207 # then, read the data 209 208 datalen=struct.unpack('>i',fid.read(struct.calcsize('>i')))[0] … … 211 210 212 211 if data_type==2: 213 # unpack scalar212 # struct.upack scalar 214 213 data=struct.unpack('>d',fid.read(struct.calcsize('>d')))[0] 215 214 elif data_type==3: … … 218 217 raw_data=np.zeros(shape=(rows,cols),dtype=float) 219 218 for i in range(rows): 220 raw_data[i,:]=struct.unpack('> %dd' % cols,fid.read(cols*struct.calcsize('>d')))221 # The matrix will be unpacked in order and will be filled left -> right by column219 raw_data[i,:]=struct.unpack('>{}d'.format(cols),fid.read(cols*struct.calcsize('>d'))) 220 # The matrix will be struct.upacked in order and will be filled left -> right by column 222 221 # We need to reshape and transpose the matrix so it can be read correctly 223 222 data=raw_data.reshape(raw_data.shape[::-1]).T 224 223 else: 225 224 raise TypeError("Cannot read data type %d" % data_type) 226 225 227 226 # give additional data to user 228 227 if data_type==2: … … 234 233 235 234 result=OrderedDict() 236 result['field_name']=fieldname 235 result['field_name']=fieldname.decode('utf8') 237 236 result['size']=data_size 238 237 result['data_type']=data_type_str -
issm/trunk-jpl/src/py3/classes/pairoptions.py
r23670 r23689 5 5 """ 6 6 PAIROPTIONS class definition 7 7 8 8 Usage: 9 9 pairoptions=pairoptions(); … … 27 27 # }}} 28 28 def __repr__(self): # {{{ 29 s=" functionname: ' %s'\n" % self.functionname29 s=" functionname: '{}'\n".format(self.functionname) 30 30 if self.list: 31 s+=" list: ( %ix%i)\n\n" %(len(self.list),2)31 s+=" list: ({}x{}) \n\n".format(len(self.list),2) 32 32 for item in self.list.items(): 33 if isinstance(item[1],str):34 s+=" field: %-10s value: '%s'\n" % (item[0],item[1])35 elif isinstance(item[1],(bool,int,float)):36 s+=" field: %-10s value: %g\n" % (item[0],item[1])37 else:38 s+=" field: %-10s value: %s\n" % (item[0],type(item[1]))33 #if isinstance(item[1],str): 34 s+=" field: {} value: '{}'\n".format((item[0],item[1])) 35 # elif isinstance(item[1],(bool,int,float)): 36 # s+=" field: %-10s value: %g\n" % (item[0],item[1]) 37 # else: 38 # s+=" field: %-10s value: %s\n" % (item[0],type(item[1])) 39 39 else: 40 40 s+=" list: empty\n" … … 46 46 #check length of input 47 47 if len(arg) % 2: 48 raise TypeError('Invalid parameter/value pair arguments') 49 numoptions = len(arg)/248 raise TypeError('Invalid parameter/value pair arguments') 49 numoptions = int(len(arg)/2) 50 50 51 51 #go through arg and build list of objects … … 55 55 else: 56 56 #option is not a string, ignore it 57 print("WARNING: option number %d is not a string and will be ignored." %(i+1))57 print("WARNING: option number {} is not a string and will be ignored.".format(i+1)) 58 58 # }}} 59 59 def addfield(self,field,value): # {{{ … … 61 61 if isinstance(field,str): 62 62 if field in self.list: 63 print("WARNING: field ' %s' with value=%s exists and will be overwritten with value=%s." %(field,str(self.list[field]),str(value)))63 print("WARNING: field '{}' with value={} exists and will be overwritten with value={}.".format(field,str(self.list[field]),str(value))) 64 64 self.list[field] = value 65 65 # }}} … … 87 87 """EXIST - check if the option exist""" 88 88 89 #some argument checking: 89 #some argument checking: 90 90 if field == None or field == '': 91 91 raise ValueError('exist error message: bad usage'); … … 102 102 """ 103 103 GETOPTION - get the value of an option 104 104 105 105 Usage: 106 106 value=options.getfieldvalue(field,default) 107 107 108 108 Find an option value from a field. A default option 109 109 can be given in input if the field does not exist 110 110 111 111 Examples: 112 112 value=options.getfieldvalue(options,'caxis') … … 114 114 """ 115 115 116 #some argument checking: 116 #some argument checking: 117 117 if field == None or field == '': 118 118 raise ValueError('getfieldvalue error message: bad usage'); … … 134 134 """ 135 135 REMOVEFIELD - delete a field in an option list 136 136 137 137 Usage: 138 138 obj=removefield(self,field,warn) 139 139 140 140 if warn==1 display an info message to warn user that 141 141 some of his options have been removed. -
issm/trunk-jpl/src/py3/consistency/checkfield.py
r23670 r23689 2 2 import os 3 3 from pairoptions import pairoptions 4 from operator import attrgetter 4 5 import MatlabFuncs as m 5 6 … … 41 42 else: 42 43 fieldname=options.getfieldvalue('fieldname') 43 exec("field=md.{}".format(fieldname)) 44 45 field=attrgetter(fieldname)(md) 46 # exec("field=md.{}".format(fieldname),namespace) 44 47 45 48 if isinstance(field,(bool,int,float)): -
issm/trunk-jpl/src/py3/solve/WriteData.py
r23670 r23689 1 1 import numpy as np 2 import struct 3 import pairoptions 4 import MatlabFuncs as m 2 from struct import pack,unpack 3 from pairoptions import pairoptions 5 4 6 5 def WriteData(fid,prefix,*args): … … 13 12 14 13 #process options 15 options=pairoptions .pairoptions(*args)14 options=pairoptions(*args) 16 15 17 16 #Get data properties … … 31 30 name = options.getfieldvalue('name') 32 31 33 format= options.getfieldvalue('format')32 datatype = options.getfieldvalue('format') 34 33 mattype = options.getfieldvalue('mattype',0) #only required for matrices 35 34 timeserieslength = options.getfieldvalue('timeserieslength',-1) … … 56 55 57 56 #Step 1: write the enum to identify this record uniquely 58 fid.write(struct.pack('i',len(name))) 59 fid.write(struct.pack('%ds' % len(name),name)) 57 fid.write(pack('>i',len(name))) 58 fid.write(pack('>{}s'.format(len(name)),name.encode())) 59 # print(name) 60 # print(pack('>{}s'.format(len(name)),name) 60 61 61 62 #Step 2: write the data itself. 62 if m.strcmpi(format,'Boolean'): # {{{63 if datatype=='Boolean': # {{{ 63 64 # if len(data) !=1: 64 65 # raise ValueError('field %s cannot be marshalled as it has more than one element!' % name[0]) 65 66 66 67 #first write length of record 67 fid.write( struct.pack('i',4+4)) #1 bool (disguised as an int)+code68 69 #write data code: 70 fid.write( struct.pack('i',FormatToCode(format)))68 fid.write(pack('>i',4+4)) #1 bool (disguised as an int)+code 69 70 #write data code: 71 fid.write(pack('>i',FormatToCode(datatype))) 71 72 72 73 #now write integer 73 fid.write( struct.pack('i',int(data))) #send an int, not easy to send a bool74 # }}} 75 76 elif m.strcmpi(format,'Integer'): # {{{74 fid.write(pack('>i',int(data))) #send an int, not easy to send a bool 75 # }}} 76 77 elif datatype=='Integer': # {{{ 77 78 # if len(data) !=1: 78 79 # raise ValueError('field %s cannot be marshalled as it has more than one element!' % name[0]) 79 80 80 81 #first write length of record 81 fid.write( struct.pack('i',4+4)) #1 integer + code82 83 #write data code: 84 fid.write( struct.pack('i',FormatToCode(format)))82 fid.write(pack('>i',4+4)) #1 integer + code 83 84 #write data code: 85 fid.write(pack('>i',FormatToCode(datatype))) 85 86 86 87 #now write integer 87 fid.write( struct.pack('i',data))88 # }}} 89 90 elif m.strcmpi(format,'Double'): # {{{88 fid.write(pack('>i',int(data))) #force an int, 89 # }}} 90 91 elif datatype=='Double': # {{{ 91 92 # if len(data) !=1: 92 93 # raise ValueError('field %s cannot be marshalled as it has more than one element!' % name[0]) 93 94 94 95 #first write length of record 95 fid.write( struct.pack('i',8+4)) #1 double+code96 97 #write data code: 98 fid.write( struct.pack('i',FormatToCode(format)))96 fid.write(pack('>i',8+4)) #1 double+code 97 98 #write data code: 99 fid.write(pack('>i',FormatToCode(datatype))) 99 100 100 101 #now write double 101 fid.write( struct.pack('d',data))102 # }}} 103 104 elif m.strcmpi(format,'String'): # {{{105 #first write length of record 106 fid.write( struct.pack('i',len(data)+4+4)) #string + string size + code107 108 #write data code: 109 fid.write( struct.pack('i',FormatToCode(format)))102 fid.write(pack('>d',data)) 103 # }}} 104 105 elif datatype=='String': # {{{ 106 #first write length of record 107 fid.write(pack('>i',len(data)+4+4)) #string + string size + code 108 109 #write data code: 110 fid.write(pack('>i',FormatToCode(datatype))) 110 111 111 112 #now write string 112 fid.write( struct.pack('i',len(data)))113 fid.write( struct.pack('%ds' % len(data),data))114 # }}} 115 116 elif m.strcmpi(format,'BooleanMat'): # {{{117 118 if isinstance(data, bool):113 fid.write(pack('>i',len(data))) 114 fid.write(pack('>{}s'.format(len(data)),data.encode())) 115 # }}} 116 117 elif datatype in ['IntMat','BooleanMat']: # {{{ 118 119 if isinstance(data,(int,bool)): 119 120 data=np.array([data]) 120 121 elif isinstance(data,(list,tuple)): … … 133 134 134 135 #first write length of record 135 fid.write( struct.pack('i',4+4+8*np.product(s)+4+4)) #2 integers (32 bits) + the double matrix + code + matrix type136 fid.write(pack('>i',4+4+8*np.product(s)+4+4)) #2 integers (32 bits) + the double matrix + code + matrix type 136 137 137 138 #write data code and matrix type: 138 fid.write( struct.pack('i',FormatToCode(format)))139 fid.write( struct.pack('i',mattype))139 fid.write(pack('>i',FormatToCode(datatype))) 140 fid.write(pack('>i',mattype)) 140 141 141 142 #now write matrix 142 if np.ndim(data) ==1:143 fid.write( struct.pack('i',s[0]))144 fid.write( struct.pack('i',1))143 if np.ndim(data) == 1: 144 fid.write(pack('>i',s[0])) 145 fid.write(pack('>i',1)) 145 146 for i in range(s[0]): 146 fid.write( struct.pack('d',float(data[i]))) #get to the "c" convention, hence the transpose147 else: 148 fid.write( struct.pack('i',s[0]))149 fid.write( struct.pack('i',s[1]))147 fid.write(pack('>d',float(data[i]))) #get to the "c" convention, hence the transpose 148 else: 149 fid.write(pack('>i',s[0])) 150 fid.write(pack('>i',s[1])) 150 151 for i in range(s[0]): 151 152 for j in range(s[1]): 152 fid.write(struct.pack('d',float(data[i][j]))) #get to the "c" convention, hence the transpose 153 # }}} 154 155 elif m.strcmpi(format,'IntMat'): # {{{ 156 157 if isinstance(data,int): 158 data=np.array([data]) 159 elif isinstance(data,(list,tuple)): 160 data=np.array(data).reshape(-1,) 161 if np.ndim(data) == 1: 162 if np.size(data): 163 data=data.reshape(np.size(data),) 164 else: 165 data=data.reshape(0,0) 166 167 #Get size 168 s=data.shape 169 #if matrix = NaN, then do not write anything 170 if np.ndim(data)==2 and np.product(s)==1 and np.all(np.isnan(data)): 171 s=(0,0) 172 173 #first write length of record 174 fid.write(struct.pack('i',4+4+8*np.product(s)+4+4)) #2 integers (32 bits) + the double matrix + code + matrix type 175 176 #write data code and matrix type: 177 fid.write(struct.pack('i',FormatToCode(format))) 178 fid.write(struct.pack('i',mattype)) 179 180 #now write matrix 181 if np.ndim(data) == 1: 182 fid.write(struct.pack('i',s[0])) 183 fid.write(struct.pack('i',1)) 184 for i in range(s[0]): 185 fid.write(struct.pack('d',float(data[i]))) #get to the "c" convention, hence the transpose 186 else: 187 fid.write(struct.pack('i',s[0])) 188 fid.write(struct.pack('i',s[1])) 189 for i in range(s[0]): 190 for j in range(s[1]): 191 fid.write(struct.pack('d',float(data[i][j]))) #get to the "c" convention, hence the transpose 192 # }}} 193 194 elif m.strcmpi(format,'DoubleMat'): # {{{ 153 fid.write(pack('>d',float(data[i][j]))) #get to the "c" convention, hence the transpose 154 # }}} 155 156 elif datatype=='DoubleMat': # {{{ 195 157 196 158 if isinstance(data,(bool,int,float)): … … 215 177 raise ValueError('field %s cannot be marshalled because it is larger than 4^31 bytes!' % enum) 216 178 217 fid.write( struct.pack('i',recordlength)) #2 integers (32 bits) + the double matrix + code + matrix type179 fid.write(pack('>i',recordlength)) #2 integers (32 bits) + the double matrix + code + matrix type 218 180 219 181 #write data code and matrix type: 220 fid.write( struct.pack('i',FormatToCode(format)))221 fid.write( struct.pack('i',mattype))182 fid.write(pack('>i',FormatToCode(datatype))) 183 fid.write(pack('>i',mattype)) 222 184 223 185 #now write matrix 224 186 if np.ndim(data) == 1: 225 fid.write( struct.pack('i',s[0]))226 fid.write( struct.pack('i',1))187 fid.write(pack('>i',s[0])) 188 fid.write(pack('>i',1)) 227 189 for i in range(s[0]): 228 fid.write( struct.pack('d',float(data[i]))) #get to the "c" convention, hence the transpose229 else: 230 fid.write( struct.pack('i',s[0]))231 fid.write( struct.pack('i',s[1]))190 fid.write(pack('>d',float(data[i]))) #get to the "c" convention, hence the transpose 191 else: 192 fid.write(pack('>i',s[0])) 193 fid.write(pack('>i',s[1])) 232 194 for i in range(s[0]): 233 195 for j in range(s[1]): 234 fid.write( struct.pack('d',float(data[i][j]))) #get to the "c" convention, hence the transpose235 # }}} 236 237 elif m.strcmpi(format,'CompressedMat'): # {{{196 fid.write(pack('>d',float(data[i][j]))) #get to the "c" convention, hence the transpose 197 # }}} 198 199 elif datatype=='CompressedMat': # {{{ 238 200 239 201 if isinstance(data,(bool,int,float)): … … 264 226 raise ValueError('field %s cannot be marshalled because it is larger than 4^31 bytes!' % enum) 265 227 266 fid.write( struct.pack('i',recordlength)) #2 integers (32 bits) + the matrix + code + matrix type228 fid.write(pack('>i',recordlength)) #2 integers (32 bits) + the matrix + code + matrix type 267 229 268 230 #write data code and matrix type: 269 fid.write( struct.pack('i',FormatToCode(format)))270 fid.write( struct.pack('i',mattype))231 fid.write(pack('>i',FormatToCode(datatype))) 232 fid.write(pack('>i',mattype)) 271 233 272 234 #Write offset and range … … 282 244 #now write matrix 283 245 if np.ndim(data) == 1: 284 fid.write( struct.pack('i',s[0]))285 fid.write( struct.pack('i',1))286 fid.write( struct.pack('d',float(offsetA)))287 fid.write( struct.pack('d',float(rangeA)))246 fid.write(pack('>i',s[0])) 247 fid.write(pack('>i',1)) 248 fid.write(pack('>d',float(offsetA))) 249 fid.write(pack('>d',float(rangeA))) 288 250 for i in range(s[0]-1): 289 fid.write( struct.pack('B',int(A[i])))290 291 fid.write( struct.pack('d',float(data[s[0]-1]))) #get to the "c" convention, hence the transpose251 fid.write(pack('>B',int(A[i]))) 252 253 fid.write(pack('>d',float(data[s[0]-1]))) #get to the "c" convention, hence the transpose 292 254 293 255 elif np.product(s) > 0: 294 fid.write( struct.pack('i',s[0]))295 fid.write( struct.pack('i',s[1]))296 fid.write( struct.pack('d',float(offsetA)))297 fid.write( struct.pack('d',float(rangeA)))256 fid.write(pack('>i',s[0])) 257 fid.write(pack('>i',s[1])) 258 fid.write(pack('>d',float(offsetA))) 259 fid.write(pack('>d',float(rangeA))) 298 260 for i in range(s[0]-1): 299 261 for j in range(s[1]): 300 fid.write( struct.pack('B',int(A[i][j]))) #get to the "c" convention, hence the transpose262 fid.write(pack('>B',int(A[i][j]))) #get to the "c" convention, hence the transpose 301 263 302 264 for j in range(s[1]): 303 fid.write( struct.pack('d',float(data[s[0]-1][j])))304 305 # }}} 306 307 elif m.strcmpi(format,'MatArray'): # {{{265 fid.write(pack('>d',float(data[s[0]-1][j]))) 266 267 # }}} 268 269 elif datatype=='MatArray': # {{{ 308 270 309 271 #first get length of record … … 324 286 325 287 #write length of record 326 fid.write( struct.pack('i',recordlength))327 328 #write data code: 329 fid.write( struct.pack('i',FormatToCode(format)))288 fid.write(pack('>i',recordlength)) 289 290 #write data code: 291 fid.write(pack('>i',FormatToCode(datatype))) 330 292 331 293 #write data, first number of records 332 fid.write( struct.pack('i',len(data)))294 fid.write(pack('>i',len(data))) 333 295 334 296 for matrix in data: … … 343 305 344 306 if np.ndim(matrix) == 1: 345 fid.write( struct.pack('i',s[0]))346 fid.write( struct.pack('i',1))307 fid.write(pack('>i',s[0])) 308 fid.write(pack('>i',1)) 347 309 for i in range(s[0]): 348 fid.write( struct.pack('d',float(matrix[i]))) #get to the "c" convention, hence the transpose310 fid.write(pack('>d',float(matrix[i]))) #get to the "c" convention, hence the transpose 349 311 else: 350 fid.write( struct.pack('i',s[0]))351 fid.write( struct.pack('i',s[1]))312 fid.write(pack('>i',s[0])) 313 fid.write(pack('>i',s[1])) 352 314 for i in range(s[0]): 353 315 for j in range(s[1]): 354 fid.write( struct.pack('d',float(matrix[i][j])))355 # }}} 356 357 elif m.strcmpi(format,'StringArray'): # {{{316 fid.write(pack('>d',float(matrix[i][j]))) 317 # }}} 318 319 elif datatype=='StringArray': # {{{ 358 320 359 321 #first get length of record … … 363 325 364 326 #write length of record 365 fid.write( struct.pack('i',recordlength))366 367 #write data code: 368 fid.write( struct.pack('i',FormatToCode(format)))327 fid.write(pack('>i',recordlength)) 328 329 #write data code: 330 fid.write(pack('>i',FormatToCode(datatype))) 369 331 370 332 #now write length of string array 371 fid.write( struct.pack('i',len(data)))333 fid.write(pack('>i',len(data))) 372 334 373 335 #now write the strings 374 336 for string in data: 375 fid.write( struct.pack('i',len(string)))376 fid.write( struct.pack('%ds' % len(string),string))337 fid.write(pack('>i',len(string))) 338 fid.write(pack('>{}s'.format(len(string)),string.encode())) 377 339 # }}} 378 340 379 341 else: # {{{ 380 raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,enum))342 raise TypeError('WriteData error message: data type: {} not supported yet! ({})'.format(datatype,enum)) 381 343 # }}} 382 344 383 def FormatToCode( format): # {{{345 def FormatToCode(datatype): # {{{ 384 346 """ 385 This routine takes the formatstring, and hardcodes it into an integer, which347 This routine takes the datatype string, and hardcodes it into an integer, which 386 348 is passed along the record, in order to identify the nature of the dataset being 387 349 sent. 388 350 """ 389 351 390 if m.strcmpi(format,'Boolean'):352 if datatype=='Boolean': 391 353 code=1 392 elif m.strcmpi(format,'Integer'):354 elif datatype=='Integer': 393 355 code=2 394 elif m.strcmpi(format,'Double'):356 elif datatype=='Double': 395 357 code=3 396 elif m.strcmpi(format,'String'):358 elif datatype=='String': 397 359 code=4 398 elif m.strcmpi(format,'BooleanMat'):360 elif datatype=='BooleanMat': 399 361 code=5 400 elif m.strcmpi(format,'IntMat'):362 elif datatype=='IntMat': 401 363 code=6 402 elif m.strcmpi(format,'DoubleMat'):364 elif datatype=='DoubleMat': 403 365 code=7 404 elif m.strcmpi(format,'MatArray'):366 elif datatype=='MatArray': 405 367 code=8 406 elif m.strcmpi(format,'StringArray'):368 elif datatype=='StringArray': 407 369 code=9 408 elif m.strcmpi(format,'CompressedMat'):370 elif datatype=='CompressedMat': 409 371 code=10 410 372 else:
Note:
See TracChangeset
for help on using the changeset viewer.