Skip to content

Commit

Permalink
Grab betainc in _special.py since the btdtr alias was removed. (#…
Browse files Browse the repository at this point in the history
…114)

Fixes #113
From scipy/scipy#22335, it seems like we
should grab `__pyx_fuse_0betainc` and not `__pyx_fuse_1betainc`
  • Loading branch information
ikrommyd authored Jan 16, 2025
1 parent 7e333ac commit ad65935
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/numba_stats/_special.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ def get(name, signature):
from scipy.special import cython_special

# scipy-1.12 started to provide fused versions for some special functions
fuse_name = f"__pyx_fuse_1{name}"
if name == "betainc":
fuse_name = f"__pyx_fuse_0{name}"
else:
fuse_name = f"__pyx_fuse_1{name}"
if fuse_name not in cython_special.__pyx_capi__:
fuse_name = name

Expand Down Expand Up @@ -39,5 +42,4 @@ def get(name, signature):
voigt_profile = get("voigt_profile", float64(float64, float64, float64))
xlogy = get("xlogy", float64(float64, float64))
xlog1py = get("xlog1py", float64(float64, float64))
# for some reason, getting betainc directly does not work! btdtr is an alias
betainc = get("btdtr", float64(float64, float64, float64))
betainc = get("betainc", float64(float64, float64, float64))

0 comments on commit ad65935

Please sign in to comment.