def test_improper_S(self): S_df = pd.DataFrame([[1, 2]], index=['F_1'], columns=['S_1', 'S_2']) O_df = pd.DataFrame( [[1, 2], [2, 1]], index=['S_1', 'S_2'], columns=['F_1', 'F_2'], ) A_df = pd.DataFrame([[1], [1]], index=['F_1', 'F_2'], columns=['Num_Positions']) with self.assertRaises(ValueError) as cm: new_dm = dm(S_df, O_df, A_df)
def test_no_A(self): S_df = pd.DataFrame([[1, 2], [2, 1]], index=['F_1', 'F_2'], columns=['S_1', 'S_2']) O_df = pd.DataFrame( [[1, 2], [2, 1]], index=['S_1', 'S_2'], columns=['F_1', 'F_2'], ) A_df = pd.DataFrame([[1], [1]], index=['F_1', 'F_2'], columns=['Num_Positions']) new_dm = dm(S_df, O_df) diff_A_df = A_df - new_dm.A_df self.assertEqual(0, diff_A_df.min().min()) self.assertEqual(0, diff_A_df.max().max())