Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ec927a4

Browse files
cclaussjreback
authored andcommittedJul 17, 2017
CLN/COMPAT: for various py2/py3 in doc/bench scripts (#16984)
1 parent ea487fc commit ec927a4

34 files changed

+14
-2042
lines changed
 

‎asv_bench/vbench_to_asv.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def translate_module(target_module):
114114
l_vars = {}
115115
exec('import ' + target_module) in g_vars
116116

117-
print target_module
117+
print(target_module)
118118
module = eval(target_module, g_vars)
119119

120120
benchmarks = []
@@ -157,7 +157,7 @@ def translate_module(target_module):
157157
mod = os.path.basename(module)
158158
if mod in ['make.py', 'measure_memory_consumption.py', 'perf_HEAD.py', 'run_suite.py', 'test_perf.py', 'generate_rst_files.py', 'test.py', 'suite.py']:
159159
continue
160-
print
161-
print mod
160+
print('')
161+
print(mod)
162162

163163
translate_module(mod.replace('.py', ''))

‎bench/alignment.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎bench/bench_dense_to_sparse.py

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎bench/bench_get_put_value.py

Lines changed: 0 additions & 56 deletions
This file was deleted.

‎bench/bench_groupby.py

Lines changed: 0 additions & 66 deletions
This file was deleted.

‎bench/bench_join_panel.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

‎bench/bench_khash_dict.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

‎bench/bench_merge.R

Lines changed: 0 additions & 161 deletions
This file was deleted.

‎bench/bench_merge.py

Lines changed: 0 additions & 105 deletions
This file was deleted.

‎bench/bench_merge_sqlite.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

‎bench/bench_pivot.R

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎bench/bench_pivot.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎bench/bench_take_indexing.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

‎bench/bench_unique.py

Lines changed: 0 additions & 278 deletions
This file was deleted.

‎bench/bench_with_subset.R

Lines changed: 0 additions & 53 deletions
This file was deleted.

‎bench/bench_with_subset.py

Lines changed: 0 additions & 116 deletions
This file was deleted.

‎bench/better_unique.py

Lines changed: 0 additions & 80 deletions
This file was deleted.

‎bench/duplicated.R

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎bench/io_roundtrip.py

Lines changed: 0 additions & 116 deletions
This file was deleted.

‎bench/larry.py

Whitespace-only changes.

‎bench/serialize.py

Lines changed: 0 additions & 89 deletions
This file was deleted.

‎bench/test.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

‎bench/zoo_bench.R

Lines changed: 0 additions & 71 deletions
This file was deleted.

‎bench/zoo_bench.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

‎doc/source/conf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
import importlib
1818
from pandas.compat import u, PY3
1919

20+
try:
21+
raw_input # Python 2
22+
except NameError:
23+
raw_input = input # Python 3
24+
2025
# https://github.com/sphinx-doc/sphinx/pull/2325/files
2126
# Workaround for sphinx-build recursion limit overflow:
2227
# pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL)

‎doc/sphinxext/ipython_sphinxext/ipython_directive.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
import sys
112112
import tempfile
113113
import ast
114-
from pandas.compat import zip, range, map, lmap, u, cStringIO as StringIO
114+
from pandas.compat import zip, range, map, lmap, u, text_type, cStringIO as StringIO
115115
import warnings
116116

117117
# To keep compatibility with various python versions
@@ -138,10 +138,8 @@
138138

139139
if PY3:
140140
from io import StringIO
141-
text_type = str
142141
else:
143142
from StringIO import StringIO
144-
text_type = unicode
145143

146144
#-----------------------------------------------------------------------------
147145
# Globals

‎scripts/find_commits_touching_func.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# copryright 2013, y-p @ github
55

66
from __future__ import print_function
7-
from pandas.compat import range, lrange, map
7+
from pandas.compat import range, lrange, map, string_types, text_type
88

99
"""Search the git history for all commits touching a named method
1010
@@ -94,7 +94,7 @@ def get_hits(defname,files=()):
9494

9595
def get_commit_info(c,fmt,sep='\t'):
9696
r=sh.git('log', "--format={}".format(fmt), '{}^..{}'.format(c,c),"-n","1",_tty_out=False)
97-
return compat.text_type(r).split(sep)
97+
return text_type(r).split(sep)
9898

9999
def get_commit_vitals(c,hlen=HASH_LEN):
100100
h,s,d= get_commit_info(c,'%H\t%s\t%ci',"\t")
@@ -183,11 +183,11 @@ def main():
183183
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
184184
""")
185185
return
186-
if isinstance(args.file_masks,compat.string_types):
186+
if isinstance(args.file_masks, string_types):
187187
args.file_masks = args.file_masks.split(',')
188-
if isinstance(args.path_masks,compat.string_types):
188+
if isinstance(args.path_masks, string_types):
189189
args.path_masks = args.path_masks.split(',')
190-
if isinstance(args.dir_masks,compat.string_types):
190+
if isinstance(args.dir_masks, string_types):
191191
args.dir_masks = args.dir_masks.split(',')
192192

193193
logger.setLevel(getattr(logging,args.debug_level))

‎scripts/windows_builder/build_27-32.bat

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎scripts/windows_builder/build_27-64.bat

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎scripts/windows_builder/build_34-32.bat

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎scripts/windows_builder/build_34-64.bat

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎scripts/windows_builder/check_and_build.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎scripts/windows_builder/check_and_build.py

Lines changed: 0 additions & 194 deletions
This file was deleted.

‎scripts/windows_builder/readme.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.