@@ -416,8 +416,8 @@ def parse_surf(filename):
416416 fp .readline ()
417417 print (comment )
418418 verts , faces = struct .unpack ('>2I' , fp .read (8 ))
419- pts = np .fromstring (fp .read (4 * 3 * verts ), dtype = 'f4' ).byteswap ()
420- polys = np .fromstring (fp .read (4 * 3 * faces ), dtype = 'i4' ).byteswap ()
419+ pts = np .frombuffer (fp .read (4 * 3 * verts ), dtype = 'f4' ).byteswap ()
420+ polys = np .frombuffer (fp .read (4 * 3 * faces ), dtype = 'i4' ).byteswap ()
421421
422422 return pts .reshape (- 1 , 3 ), polys .reshape (- 1 , 3 )
423423
@@ -470,7 +470,7 @@ def parse_curv(filename):
470470 """
471471 with open (filename , 'rb' ) as fp :
472472 fp .seek (15 )
473- return np .fromstring (fp .read (), dtype = '>f4' ).byteswap ().view (np .dtype ('>f4' ).newbyteorder ('=' ))
473+ return np .frombuffer (fp .read (), dtype = '>f4' ).byteswap ().view (np .dtype ('>f4' ).newbyteorder ('=' ))
474474
475475
476476def parse_patch (filename ):
@@ -479,7 +479,7 @@ def parse_patch(filename):
479479 with open (filename , 'rb' ) as fp :
480480 header , = struct .unpack ('>i' , fp .read (4 ))
481481 nverts , = struct .unpack ('>i' , fp .read (4 ))
482- data = np .fromstring (fp .read (), dtype = [('vert' , '>i4' ), ('x' , '>f4' ),
482+ data = np .frombuffer (fp .read (), dtype = [('vert' , '>i4' ), ('x' , '>f4' ),
483483 ('y' , '>f4' ), ('z' , '>f4' )])
484484 assert len (data ) == nverts
485485 return data
0 commit comments