@@ -107,11 +107,11 @@ def __init__(
107107 _group_columns = self .__posthoc_group_cols ,
108108 )
109109
110- def __warn_empty_comparisons (self , _comparison_type_name ):
110+ def __warn_empty_comparisons (self , _comparison_type_name : str ):
111111
112112 warnings .warn (f"{ _comparison_type_name } were empty" , UserWarning )
113113
114- def __is_iterable_with_strings (self , _data_structure ):
114+ def __is_iterable_with_strings (self , _data_structure : Any ):
115115
116116 prefix_msg = "Expected an Iterable of Strings."
117117
@@ -125,7 +125,7 @@ def __is_iterable_with_strings(self, _data_structure):
125125 if any (not isinstance (element , str ) for element in _data_structure ):
126126 raise TypeError (f"{ prefix_msg } Data in Iterable is not of type String." )
127127
128- def __get_group_column_idxs (self , _group_columns ):
128+ def __get_group_column_idxs (self , _group_columns : list [ str ] ):
129129 """Get group fields after removing dropped columns."""
130130
131131 return [
@@ -145,11 +145,15 @@ def __get_group_column_element(
145145 else :
146146 return _group_column_data
147147
148- def __contains_match (self , _groups ):
148+ def __contains_match (
149+ self ,
150+ _groups : Union [tuple [tuple [Any ]], tuple [Any ]],
151+ _group_columns : list [str ],
152+ ):
149153 """Check if the same features between both groups are the same value."""
150154
151155 if not self .__one_different_comparison :
152- if len (self . __posthoc_group_cols ) == 1 :
156+ if len (_group_columns ) == 1 :
153157 if _groups [0 ] == _groups [1 ]:
154158 return True
155159
@@ -176,7 +180,9 @@ def inter_comparisons(self):
176180 # Iterate through each ante group combination
177181 for apair in apairs :
178182
179- if self .__contains_match (apair ):
183+ # Don't make a comparison if with this pair if
184+ # any of the corresponding column values match
185+ if self .__contains_match (apair , self .__antehoc_group_cols ):
180186 continue
181187
182188 apair = tuple (
@@ -212,7 +218,9 @@ def inter_comparisons(self):
212218 # Iterate through each well group cartesian product and save the data
213219 for ppair in comparison_key_product :
214220
215- if self .__contains_match (ppair ):
221+ # Don't make a comparison if with this pair if
222+ # any of the corresponding column values match
223+ if self .__contains_match (ppair , self .__posthoc_group_cols ):
216224 continue
217225
218226 ppair = tuple (
@@ -292,7 +300,9 @@ def intra_comparisons(self):
292300 # Iterate through the combinations pairs of the groups
293301 for ppair in comparison_key_combinations :
294302
295- if self .__contains_match (ppair ):
303+ # Don't make a comparison if with this pair if
304+ # any of the corresponding column values match
305+ if self .__contains_match (ppair , self .__posthoc_group_cols ):
296306 continue
297307
298308 ppair = tuple (
0 commit comments