File tree 3 files changed +150
-123
lines changed
3 files changed +150
-123
lines changed Original file line number Diff line number Diff line change 1
- import os
1
+ from pathlib import Path
2
2
3
3
from pandas import read_sas
4
4
5
+ ROOT = Path (__file__ ).parents [3 ] / "pandas" / "tests" / "io" / "sas" / "data"
6
+
5
7
6
8
class SAS :
9
+ def time_read_sas7bdat (self ):
10
+ read_sas (ROOT / "test1.sas7bdat" )
7
11
8
- params = [ "sas7bdat" , "xport" ]
9
- param_names = [ "format" ]
12
+ def time_read_xpt ( self ):
13
+ read_sas ( ROOT / "paxraw_d_short.xpt" )
10
14
11
- def setup (self , format ):
12
- # Read files that are located in 'pandas/tests/io/sas/data'
13
- files = {"sas7bdat" : "test1.sas7bdat" , "xport" : "paxraw_d_short.xpt" }
14
- file = files [format ]
15
- paths = [
16
- os .path .dirname (__file__ ),
17
- ".." ,
18
- ".." ,
19
- ".." ,
20
- "pandas" ,
21
- "tests" ,
22
- "io" ,
23
- "sas" ,
24
- "data" ,
25
- file ,
26
- ]
27
- self .f = os .path .join (* paths )
15
+ def time_read_sas7bdat_2 (self ):
16
+ next (read_sas (ROOT / "0x00controlbyte.sas7bdat.bz2" , chunksize = 11000 ))
28
17
29
- def time_read_sas (self , format ):
30
- read_sas (self .f , format = format )
18
+ def time_read_sas7bdat_2_chunked (self ):
19
+ for i , _ in enumerate (
20
+ read_sas (ROOT / "0x00controlbyte.sas7bdat.bz2" , chunksize = 1000 )
21
+ ):
22
+ if i == 10 :
23
+ break
You can’t perform that action at this time.
0 commit comments