File tree Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -266,21 +266,20 @@ def from_string(klass, string):
266
266
klass ._inner_type .from_string ('\n ' .join (lines [:25 ])))
267
267
lta ._xforms [- 1 ].structarr ['type' ] = sa ['type' ]
268
268
lines = lines [25 :]
269
- if lines :
270
- for key in ('subject' , 'fscale' ):
271
- # Optional keys
272
- if not lines [0 ].startswith (key ):
273
- continue
274
- try :
275
- label , valstring = lines .pop (0 ).split (' ' )
276
- except ValueError :
277
- sa [key ] = ''
278
- else :
279
- assert label .strip () == key
280
-
281
- val = np .genfromtxt ([valstring .encode ()],
282
- dtype = klass .dtype [key ])
283
- sa [key ] = val .reshape (sa [key ].shape ) if val .size else ''
269
+ for key in ('subject' , 'fscale' ):
270
+ # Optional keys
271
+ if not (lines and lines [0 ].startswith (key )):
272
+ continue
273
+ try :
274
+ label , valstring = lines .pop (0 ).split (' ' )
275
+ except ValueError :
276
+ sa [key ] = ''
277
+ else :
278
+ assert label .strip () == key
279
+
280
+ val = np .genfromtxt ([valstring .encode ()],
281
+ dtype = klass .dtype [key ])
282
+ sa [key ] = val .reshape (sa [key ].shape ) if val .size else ''
284
283
285
284
assert len (lta ._xforms ) == sa ['nxforms' ]
286
285
return lta
You can’t perform that action at this time.
0 commit comments