Skip to content

Commit db2114a

Browse files
committed
TST: renamed io b/c module conflict, made suite check for config
1 parent c3329d0 commit db2114a

File tree

3 files changed

+25
-13
lines changed

3 files changed

+25
-13
lines changed

pandas/io/parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,10 @@ def _make_reader(self, f):
270270
if self.encoding is not None:
271271
self.buf.extend(list(
272272
com.UnicodeReader(StringIO(line),
273-
dialect=dia,
273+
dialect=dia,
274274
encoding=self.encoding)))
275275
else:
276-
self.buf.extend(list(csv.reader(StringIO(line),
276+
self.buf.extend(list(csv.reader(StringIO(line),
277277
dialect=dia)))
278278

279279
if self.encoding is not None:

vb_suite/io.py renamed to vb_suite/io_bench.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from vbench.benchmark import Benchmark
1+
from vbench.api import Benchmark
22
from datetime import datetime
33

44
common_setup = """from pandas_vb_common import *
@@ -7,7 +7,7 @@
77
#----------------------------------------------------------------------
88
# read_csv
99

10-
setup = common_setup + """
10+
setup1 = common_setup + """
1111
index = [rands(10) for _ in xrange(10000)]
1212
df = DataFrame({'float1' : randn(10000),
1313
'float2' : randn(10000),
@@ -18,14 +18,14 @@
1818
df.to_csv('__test__.csv')
1919
"""
2020

21-
read_csv_standard = Benchmark("read_csv('__test__.csv')", setup,
21+
read_csv_standard = Benchmark("read_csv('__test__.csv')", setup1,
2222
start_date=datetime(2011, 9, 15))
2323

2424

2525
#----------------------------------------------------------------------
2626
# write_csv
2727

28-
setup = common_setup + """
28+
setup2 = common_setup + """
2929
index = [rands(10) for _ in xrange(10000)]
3030
df = DataFrame({'float1' : randn(10000),
3131
'float2' : randn(10000),
@@ -35,6 +35,6 @@
3535
index=index)
3636
"""
3737

38-
write_csv_standard = Benchmark("df.to_csv('__test__.csv')", setup,
38+
write_csv_standard = Benchmark("df.to_csv('__test__.csv')", setup2,
3939
start_date=datetime(2011, 9, 15))
4040

vb_suite/suite.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
modules = ['groupby', 'indexing', 'reindex',
77
'sparse', 'index_object', 'miscellaneous',
88
'stat_ops', 'join_merge', 'panel_ctor', 'frame_ctor',
9-
'frame_methods', 'io']
9+
'frame_methods', 'io_bench']
1010

1111
by_module = {}
1212
benchmarks = []
@@ -20,10 +20,22 @@
2020
for bm in benchmarks:
2121
assert(bm.name is not None)
2222

23-
REPO_PATH = '/home/adam/code/pandas'
24-
REPO_URL = 'git@github.com:adamklein/pandas.git'
25-
DB_PATH = '/home/adam/code/pandas/vb_suite/benchmarks.db'
26-
TMP_DIR = '/home/adam/tmp/vb_pandas'
23+
try:
24+
import ConfigParser
25+
26+
config = ConfigParser.ConfigParser()
27+
config.readfp(open(os.path.expanduser('~/.vbenchcfg')))
28+
29+
REPO_PATH = config.get('setup', 'repo_path')
30+
REPO_URL = config.get('setup', 'repo_url')
31+
DB_PATH = config.get('setup', 'db_path')
32+
TMP_DIR = config.get('setup', 'tmp_dir')
33+
except:
34+
REPO_PATH = '/home/wesm/code/pandas'
35+
REPO_URL = 'git@github.com:wesm/pandas.git'
36+
DB_PATH = '/home/wesm/code/pandas/vb_suite/benchmarks.db'
37+
TMP_DIR = '/home/wesm/tmp/vb_pandas'
38+
2739
PREPARE = """
2840
python setup.py clean
2941
"""
@@ -40,7 +52,7 @@
4052

4153
# HACK!
4254

43-
timespan = [datetime(2011, 1, 1), datetime(2012, 1, 1)]
55+
#timespan = [datetime(2011, 1, 1), datetime(2012, 1, 1)]
4456

4557
def generate_rst_files(benchmarks):
4658
import matplotlib as mpl

0 commit comments

Comments
 (0)