@@ -175,26 +175,26 @@ def weighted_mean_std_ufunc(
175175
176176
177177@lru_cache (maxsize = 4096 )
178- def get_combinations (iterable , size ):
178+ def get_combinations (array_length , comb_size ):
179179 """
180- Generate all possible combinations of elements of a given `size` from
181- the given `iterable `.
180+ Generate all possible index combinations of elements of a given `comb_size`
181+ from an array with a given `array_length `.
182182
183183 Uses ``itertools.combinations`` and caching to speed up repeated calls.
184184
185185 Parameters
186186 ----------
187- iterable: iterable
188- Input iterable from which to generate combinations.
187+ array_length: int
188+ Length of the list or array to generate index combinations from .
189189 size : int
190190 The size of each combination.
191191
192192 Returns
193193 -------
194194 np.ndarray
195- Array of combinations of the specified size.
195+ Array of indey combinations of the specified size.
196196 """
197- return np .array (list (combinations (iterable , size )))
197+ return np .array (list (combinations (range ( array_length ), comb_size )))
198198
199199
200200@njit
@@ -470,9 +470,9 @@ def create_combs_array(max_multiplicity, k):
470470 - An array of all k-combinations for different multiplicities.
471471 - An array mapping each combination to its respective multiplicity.
472472 """
473- combs_array = get_combinations (range ( k ) , k )
473+ combs_array = get_combinations (k , k )
474474 for i in range (k + 1 , max_multiplicity + 1 ):
475- combs = get_combinations (range ( i ) , k )
475+ combs = get_combinations (i , k )
476476 combs_array = np .concatenate ([combs_array , combs ])
477477
478478 n_combs = _calc_n_combs (np .arange (k , max_multiplicity + 1 ), k )
0 commit comments