1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
Description: Replace pd.util.testing with pd.testing as the former has been pruned in pandas2.x
Author: Nilesh Patra <nilesh@debian.org>
Last-Update: 2024-02-04
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -202,7 +202,7 @@
feature_mf['Second'] = ['No', 'Yes', 'Noes', 'Noooo', 'Yep']
# it is redundant, but the mapping file should remain untouched
- pd.util.testing.assert_frame_equal(feature_mf, emp.feature_mf,
+ pd.testing.assert_frame_equal(feature_mf, emp.feature_mf,
check_names=False)
self.assertEqual(emp.base_url, 'https://cdn.rawgit.com/biocore/emperor'
@@ -223,7 +223,7 @@
'f.PC.481', 'f.PC.354'])
empty_mf['all'] = 'All elements'
- pd.util.testing.assert_frame_equal(empty_mf, emp.feature_mf,
+ pd.testing.assert_frame_equal(empty_mf, emp.feature_mf,
check_names=False)
self.assertEqual(emp.base_url, 'https://cdn.rawgit.com/biocore/emperor'
@@ -291,7 +291,7 @@
expected.loc['PC.634'] = ['This element has no metadata'] * 3
- pd.util.testing.assert_frame_equal(expected.sort_index(),
+ pd.testing.assert_frame_equal(expected.sort_index(),
emp.mf.sort_index(),
check_names=False)
@@ -313,7 +313,7 @@
expected.loc['f.PC.636'] = ['This element has no metadata'] * 2
- pd.util.testing.assert_frame_equal(expected.sort_index(),
+ pd.testing.assert_frame_equal(expected.sort_index(),
emp.feature_mf.sort_index(),
check_names=False)
--- a/tests/test_pandas.py
+++ b/tests/test_pandas.py
@@ -66,9 +66,9 @@
self.assertTrue(isinstance(emp, Emperor))
self.assertEqual(emp.dimensions, 4)
- pd.util.testing.assert_frame_equal(self.df, emp.mf)
+ pd.testing.assert_frame_equal(self.df, emp.mf)
- pd.util.testing.assert_frame_equal(emp.ordination.samples,
+ pd.testing.assert_frame_equal(emp.ordination.samples,
self.samples)
def test_scatterplot_reordered(self):
@@ -80,11 +80,11 @@
self.assertEqual(emp.base_url, 'https://cdn.rawgit.com/biocore/'
'emperor/new-api/emperor/support_files')
- pd.util.testing.assert_frame_equal(self.df, emp.mf)
+ pd.testing.assert_frame_equal(self.df, emp.mf)
reordered = self.samples[['num_3', 'num_2', 'num_1', 'num_4']].copy()
- pd.util.testing.assert_frame_equal(emp.ordination.samples,
+ pd.testing.assert_frame_equal(emp.ordination.samples,
reordered)
def test_bad_column_names(self):
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -282,7 +282,7 @@
mf = pd.DataFrame(data=MAPPING_FILE_DATA, columns=columns)
obs = validate_and_process_custom_axes(mf, ['DOB'])
exp = pd.DataFrame(data=MAPPING_FILE_DATA_CONVERTED, columns=columns)
- pd.util.testing.assert_frame_equal(obs, exp)
+ pd.testing.assert_frame_equal(obs, exp)
def test_custom_axes_non_existent_names(self):
columns = ['SampleID', 'BarcodeSequence', 'LinkerPrimerSequence',
|