Skip to content

ENH: special: extend nbdtr and friends for float n instead of truncation #15596

@grlee77

Description

@grlee77

When working on porting some scipy.special functions to CuPy, I noticed that there was a scheduled deprecation for SciPy 1.7 that has not yet been carried out. Specifically, the unsafe double->int casting for the n or k inputs to binomial distribution functions bdtr, bdtrc and bdtri leads to the following warning:

cdef inline void _legacy_deprecation(char *func_name, double x, double y) nogil:
with gil:
PyErr_WarnEx_noerr(DeprecationWarning,
"non-integer arg n is deprecated, removed in SciPy 1.7.x",
1)

I thought about making a PR to complete the deprecation, however, I am not sure how best to proceed with that as it seems inconsistent with other functions in that same file. For example the functions related to negative binomial distributions (nbdtr, nbdtrc and nbdtri) and others instead raise a RuntimeWarning and do not indicate that the unsafe casting is deprecated. Shouldn't the approach for bdtr and nbdtr be the consistent? Please advise.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions