Skip to content

Commit c9a27ed

Browse files
CLN: fix some issues in asv benchmark suite (#13630)
* CLN: fix params list * Fix issue in asv.conf.json for win32+other environment Fix mistaken exclusion of virtualenv or existing:same on win32 in the config. Credits: @pv * CLN: remove DataMatrix * ASV: fix exlusion of tables package for non-conda environments
1 parent 3f6d4bd commit c9a27ed

File tree

4 files changed

+8
-44
lines changed

4 files changed

+8
-44
lines changed

asv_bench/asv.conf.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@
7777
// On conda install pytables, otherwise tables
7878
{"environment_type": "conda", "tables": ""},
7979
{"environment_type": "conda", "pytables": null},
80-
{"environment_type": "virtualenv", "tables": null},
81-
{"environment_type": "virtualenv", "pytables": ""},
80+
{"environment_type": "(?!conda).*", "tables": null},
81+
{"environment_type": "(?!conda).*", "pytables": ""},
8282
// On conda&win32, install libpython
8383
{"sys_platform": "(?!win32).*", "libpython": ""},
84-
{"sys_platform": "win32", "libpython": null},
84+
{"environment_type": "conda", "sys_platform": "win32", "libpython": null},
8585
{"environment_type": "(?!conda).*", "libpython": ""}
8686
],
8787
"include": [],

asv_bench/benchmarks/indexing.py

-20
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,6 @@ def time_dataframe_getitem_scalar(self):
1919
self.df[self.col][self.idx]
2020

2121

22-
class datamatrix_getitem_scalar(object):
23-
goal_time = 0.2
24-
25-
def setup(self):
26-
try:
27-
self.klass = DataMatrix
28-
except:
29-
self.klass = DataFrame
30-
self.index = tm.makeStringIndex(1000)
31-
self.columns = tm.makeStringIndex(30)
32-
self.df = self.klass(np.random.rand(1000, 30), index=self.index, columns=self.columns)
33-
self.idx = self.index[100]
34-
self.col = self.columns[10]
35-
36-
def time_datamatrix_getitem_scalar(self):
37-
self.df[self.col][self.idx]
38-
39-
4022
class series_get_value(object):
4123
goal_time = 0.2
4224

@@ -498,5 +480,3 @@ def setup(self):
498480

499481
def time_float_loc(self):
500482
self.ind.get_loc(0)
501-
502-

asv_bench/benchmarks/inference.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ class to_numeric(object):
143143

144144
param_names = ['data', 'downcast']
145145
params = [
146-
[(['1'] * N / 2) + ([2] * N / 2),
147-
(['-1'] * N / 2) + ([2] * N / 2),
148-
np.repeat(np.array('1970-01-01', '1970-01-02',
146+
[(['1'] * (N / 2)) + ([2] * (N / 2)),
147+
(['-1'] * (N / 2)) + ([2] * (N / 2)),
148+
np.repeat(np.array(['1970-01-01', '1970-01-02'],
149149
dtype='datetime64[D]'), N),
150-
(['1.1'] * N / 2) + ([2] * N / 2),
151-
([1] * N / 2) + ([2] * N / 2),
150+
(['1.1'] * (N / 2)) + ([2] * (N / 2)),
151+
([1] * (N / 2)) + ([2] * (N / 2)),
152152
np.repeat(np.int32(1), N)],
153153
[None, 'integer', 'signed', 'unsigned', 'float'],
154154
]

asv_bench/benchmarks/join_merge.py

-16
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ def setup(self):
179179
self.df_multi = DataFrame(np.random.randn(len(self.index2), 4), index=self.index2, columns=['A', 'B', 'C', 'D'])
180180
except:
181181
pass
182-
try:
183-
self.DataFrame = DataMatrix
184-
except:
185-
pass
186182
self.df = pd.DataFrame({'data1': np.random.randn(100000), 'data2': np.random.randn(100000), 'key1': self.key1, 'key2': self.key2, })
187183
self.df_key1 = pd.DataFrame(np.random.randn(len(self.level1), 4), index=self.level1, columns=['A', 'B', 'C', 'D'])
188184
self.df_key2 = pd.DataFrame(np.random.randn(len(self.level2), 4), index=self.level2, columns=['A', 'B', 'C', 'D'])
@@ -210,10 +206,6 @@ def setup(self):
210206
self.df_multi = DataFrame(np.random.randn(len(self.index2), 4), index=self.index2, columns=['A', 'B', 'C', 'D'])
211207
except:
212208
pass
213-
try:
214-
self.DataFrame = DataMatrix
215-
except:
216-
pass
217209
self.df = pd.DataFrame({'data1': np.random.randn(100000), 'data2': np.random.randn(100000), 'key1': self.key1, 'key2': self.key2, })
218210
self.df_key1 = pd.DataFrame(np.random.randn(len(self.level1), 4), index=self.level1, columns=['A', 'B', 'C', 'D'])
219211
self.df_key2 = pd.DataFrame(np.random.randn(len(self.level2), 4), index=self.level2, columns=['A', 'B', 'C', 'D'])
@@ -241,10 +233,6 @@ def setup(self):
241233
self.df_multi = DataFrame(np.random.randn(len(self.index2), 4), index=self.index2, columns=['A', 'B', 'C', 'D'])
242234
except:
243235
pass
244-
try:
245-
self.DataFrame = DataMatrix
246-
except:
247-
pass
248236
self.df = pd.DataFrame({'data1': np.random.randn(100000), 'data2': np.random.randn(100000), 'key1': self.key1, 'key2': self.key2, })
249237
self.df_key1 = pd.DataFrame(np.random.randn(len(self.level1), 4), index=self.level1, columns=['A', 'B', 'C', 'D'])
250238
self.df_key2 = pd.DataFrame(np.random.randn(len(self.level2), 4), index=self.level2, columns=['A', 'B', 'C', 'D'])
@@ -272,10 +260,6 @@ def setup(self):
272260
self.df_multi = DataFrame(np.random.randn(len(self.index2), 4), index=self.index2, columns=['A', 'B', 'C', 'D'])
273261
except:
274262
pass
275-
try:
276-
self.DataFrame = DataMatrix
277-
except:
278-
pass
279263
self.df = pd.DataFrame({'data1': np.random.randn(100000), 'data2': np.random.randn(100000), 'key1': self.key1, 'key2': self.key2, })
280264
self.df_key1 = pd.DataFrame(np.random.randn(len(self.level1), 4), index=self.level1, columns=['A', 'B', 'C', 'D'])
281265
self.df_key2 = pd.DataFrame(np.random.randn(len(self.level2), 4), index=self.level2, columns=['A', 'B', 'C', 'D'])

0 commit comments

Comments
 (0)