Skip to content

Commit d9cc058

Browse files
author
y-p
committed
BLD: test_perf, revert s/save/to_pickle change, warn the unwary
1 parent c48db2f commit d9cc058

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

vb_suite/test_perf.py

+19-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,21 @@
2626
2727
"""
2828

29+
# IMPORTANT NOTE
30+
#
31+
# This script should run on pandas versions at least as far back as 0.9.1.
32+
# devs should be able to use the latest version of this script with
33+
# any dusty old commit and expect it to "just work".
34+
# One way in which this is useful is when collecting historical data,
35+
# where writing some logic around this script may prove easier
36+
# in some cases then running vbench directly (think perf bisection).
37+
#
38+
# *please*, when you modify this script for whatever reason,
39+
# make sure you do not break it's functionality when running under older
40+
# pandas versions.
41+
# Note that depreaction warnings are turned off in main(), so there's
42+
# no need to change the actual code to supress such warnings.
43+
2944
import shutil
3045
import os
3146
import sys
@@ -302,7 +317,7 @@ def report_comparative(head_res,baseline_res):
302317

303318
if args.outdf:
304319
prprint("The results DataFrame was written to '%s'\n" % args.outdf)
305-
totals.to_pickle(args.outdf)
320+
totals.save(args.outdf)
306321

307322
def profile_head_single(benchmark):
308323
import gc
@@ -378,7 +393,7 @@ def profile_head(benchmarks):
378393

379394
if args.outdf:
380395
prprint("The results DataFrame was written to '%s'\n" % args.outdf)
381-
DataFrame(results).to_pickle(args.outdf)
396+
DataFrame(results).save(args.outdf)
382397

383398
def print_report(df,h_head=None,h_msg="",h_baseline=None,b_msg=""):
384399

@@ -462,8 +477,8 @@ def main():
462477
np.random.seed(args.seed)
463478

464479
if args.base_pickle and args.target_pickle:
465-
baseline_res = prep_pickle_for_total(pd.read_pickle(args.base_pickle))
466-
target_res = prep_pickle_for_total(pd.read_pickle(args.target_pickle))
480+
baseline_res = prep_pickle_for_total(pd.load(args.base_pickle))
481+
target_res = prep_pickle_for_total(pd.load(args.target_pickle))
467482

468483
report_comparative(target_res, baseline_res)
469484
sys.exit(0)

0 commit comments

Comments
 (0)