Skip to content

Commit dc32aa0

Browse files
leotrsclaude
andcommitted
refactor: standardize on scipy.special.comb over binom
Replace the last two uses of scipy.special.binom with comb for consistency with the rest of the codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2a28f2e commit dc32aa0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

xgi/algorithms/simpliciality.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,11 @@ def _missing_subfaces(t, face, min_size=1):
472472

473473

474474
def _max_number_of_subfaces(min_size, max_size):
475-
from scipy.special import binom
475+
from scipy.special import comb
476476

477477
d = 2**max_size - 2 # subtract 2 for the face itself and the empty set
478478
for i in range(1, min_size):
479-
d -= binom(max_size, i)
479+
d -= comb(max_size, i, exact=True)
480480
return int(d)
481481

482482

xgi/utils/tensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ def banerjee_coeff(size, max_size):
7474
Sinan Aksoy, Ilya Amburg, Stephen Young,
7575
https://doi.org/10.1137/23M1584472
7676
"""
77-
from scipy.special import binom
77+
from scipy.special import comb
7878

7979
return sum(
80-
((-1) ** j) * binom(size, j) * (size - j) ** max_size for j in range(size + 1)
80+
((-1) ** j) * comb(size, j) * (size - j) ** max_size for j in range(size + 1)
8181
)
8282

8383

0 commit comments

Comments
 (0)