13
13
import traceback
14
14
15
15
from datetime import datetime
16
- from functools import wraps , partial
16
+ from functools import wraps
17
17
from contextlib import contextmanager
18
18
19
19
from numpy .random import randn , rand
@@ -1266,14 +1266,13 @@ def assert_frame_equal(left, right, check_dtype=True,
1266
1266
obj = 'DataFrame.iloc[:, {idx}]' .format (idx = i ))
1267
1267
1268
1268
1269
- def assert_panelnd_equal (left , right ,
1270
- check_dtype = True ,
1271
- check_panel_type = False ,
1272
- check_less_precise = False ,
1273
- assert_func = assert_frame_equal ,
1274
- check_names = False ,
1275
- by_blocks = False ,
1276
- obj = 'Panel' ):
1269
+ def assert_panel_equal (left , right ,
1270
+ check_dtype = True ,
1271
+ check_panel_type = False ,
1272
+ check_less_precise = False ,
1273
+ check_names = False ,
1274
+ by_blocks = False ,
1275
+ obj = 'Panel' ):
1277
1276
"""Check that left and right Panels are equal.
1278
1277
1279
1278
Parameters
@@ -1288,7 +1287,6 @@ def assert_panelnd_equal(left, right,
1288
1287
Specify comparison precision. Only used when check_exact is False.
1289
1288
5 digits (False) or 3 digits (True) after decimal points are compared.
1290
1289
If int, then specify the digits to compare
1291
- assert_func : function for comparing data
1292
1290
check_names : bool, default True
1293
1291
Whether to check the Index names attribute.
1294
1292
by_blocks : bool, default False
@@ -1322,19 +1320,15 @@ def assert_panelnd_equal(left, right,
1322
1320
assert item in right , msg
1323
1321
litem = left .iloc [i ]
1324
1322
ritem = right .iloc [i ]
1325
- assert_func (litem , ritem , check_less_precise = check_less_precise )
1323
+ assert_frame_equal (litem , ritem ,
1324
+ check_less_precise = check_less_precise ,
1325
+ check_names = check_names )
1326
1326
1327
1327
for i , item in enumerate (right ._get_axis (0 )):
1328
1328
msg = "non-matching item (left) '{item}'" .format (item = item )
1329
1329
assert item in left , msg
1330
1330
1331
1331
1332
- # TODO: strangely check_names fails in py3 ?
1333
- _panel_frame_equal = partial (assert_frame_equal , check_names = False )
1334
- assert_panel_equal = partial (assert_panelnd_equal ,
1335
- assert_func = _panel_frame_equal )
1336
-
1337
-
1338
1332
# -----------------------------------------------------------------------------
1339
1333
# Sparse
1340
1334
0 commit comments