Changeset 26129
- Timestamp:
- 03/23/21 06:16:57 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/io/loadvars.py
r26128 r26129 30 30 filename = '' 31 31 nvdict = {} 32 debug = False #print messages if true32 debug = True #print messages if true 33 33 34 34 if len(args) >= 1 and isinstance(args[0], str): … … 174 174 for groupindex, listclass in enumerate(groupclass): 175 175 for var in listclass.variables: 176 if debug:177 print(" ==> treating var {}".format(var))178 176 if var not in ['errlog', 'outlog']: 179 177 varval = listclass.variables[str(var)] 180 178 vardim = varval.ndim 179 if debug: 180 print(" ==> treating var {} of dimension {}".format(var, vardim)) 181 181 #There is a special treatment for results to account for its specific structure 182 182 #that is the new export version where time is a named dimension … … 263 263 strings2 = [str(arg[1]) for arg in varval] 264 264 Tree.__dict__[str(var)] = OrderedDict(list(zip(strings1, strings2))) 265 else: 266 if type(Tree) == list: 267 t = indexlist[i] 268 if listtype == 'dict': 269 Tree[t][str(var)] = varval[:, :].data 270 else: 271 Tree[t].__dict__[str(var)] = varval[:, :].data 272 else: 273 Tree.__dict__[str(var)] = varval[:, :].data 265 274 elif vardim == 3: 266 275 Tree.__dict__[str(var)] = varval[:, :, :].data
Note:
See TracChangeset
for help on using the changeset viewer.