33from spotpython .utils .compare import check_identical_columns_and_rows , check_identical_columns_and_rows_with_tol
44
55def test_check_exact_identical_columns_and_rows_remove_true ():
6+ # Test DataFrame with exact duplicate columns
67 df1 = pd .DataFrame ({
78 "A" : [1 , 2 , 3 ],
89 "B" : [1 , 2 , 3 ],
@@ -15,6 +16,7 @@ def test_check_exact_identical_columns_and_rows_remove_true():
1516 assert identical_rows == [], "Incorrectly identified duplicate rows where none exist"
1617
1718def test_check_exact_identical_columns_and_rows_remove_false ():
19+ # Test DataFrame checks presence of duplicates without removing
1820 df1 = pd .DataFrame ({
1921 "A" : [1 , 2 , 3 ],
2022 "B" : [1 , 2 , 3 ],
@@ -27,6 +29,7 @@ def test_check_exact_identical_columns_and_rows_remove_false():
2729 assert identical_rows == [], "Incorrectly found duplicate rows"
2830
2931def test_check_identical_columns_and_rows_with_tol_remove_true ():
32+ # Test DataFrame with near-duplicate tolerance checks for columns
3033 df1 = pd .DataFrame ({
3134 "A" : [1.00 , 2.01 , 3.00 ],
3235 "B" : [1.01 , 2.00 , 3.01 ],
@@ -39,6 +42,7 @@ def test_check_identical_columns_and_rows_with_tol_remove_true():
3942 assert identical_rows == [], "Incorrectly found duplicate rows"
4043
4144def test_check_identical_columns_and_rows_with_tol_remove_false ():
45+ # Test DataFrame with tolerance execution, no removal
4246 df1 = pd .DataFrame ({
4347 "A" : [1.00 , 2.01 , 3.00 ],
4448 "B" : [1.01 , 2.00 , 3.01 ],
@@ -51,6 +55,7 @@ def test_check_identical_columns_and_rows_with_tol_remove_false():
5155 assert identical_rows == [], "Incorrectly found duplicate rows"
5256
5357def test_with_no_duplicates ():
58+ # Tests scenarios where there are no duplicate columns or rows present
5459 df = pd .DataFrame ({
5560 "X" : [1 , 2 , 3 ],
5661 "Y" : [4 , 5 , 6 ],
0 commit comments