Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: scipy.special.factorial2 doesn't handle uint32 dtypes #20580

Closed
jonathf opened this issue Apr 25, 2024 · 1 comment · Fixed by #20607
Closed

BUG: scipy.special.factorial2 doesn't handle uint32 dtypes #20580

jonathf opened this issue Apr 25, 2024 · 1 comment · Fixed by #20607
Assignees
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.special
Milestone

Comments

@jonathf
Copy link

jonathf commented Apr 25, 2024

Describe your issue.

Double factorial does't work on uint32 dtypes in version 1.13 which is not an issue in 1.12.

Reproducing Code Example

print(scipy.special.factorial2(numpy.array(3, dtype="int")))
print(scipy.special.factorial2(numpy.array(3, dtype="uint32")))

Error message

3.
/Users/jonathf/personal/chaospy/.311/lib/python3.11/site-packages/scipy/special/_basic.py:2930: RuntimeWarning: overflow encountered in scalar negative
  def corr(k, r): return np.power(k, -r / k) / gamma(r / k + 1) * r
/Users/jonathf/personal/chaospy/.311/lib/python3.11/site-packages/scipy/special/_basic.py:2930: RuntimeWarning: overflow encountered in power
  def corr(k, r): return np.power(k, -r / k) / gamma(r / k + 1) * r
inf

SciPy/NumPy/Python version and system information

1.13.0 1.26.4 sys.version_info(major=3, minor=11, micro=5, releaselevel='final', serial=0)
Build Dependencies:
  blas:
    detection method: pkgconfig
    found: true
    include directory: /usr/local/include
    lib directory: /usr/local/lib
    name: openblas
    openblas configuration: USE_64BITINT=0 DYNAMIC_ARCH=1 DYNAMIC_OLDER= NO_CBLAS=
      NO_LAPACK= NO_LAPACKE= NO_AFFINITY=1 USE_OPENMP= SANDYBRIDGE MAX_THREADS=64
    pc file directory: /usr/local/lib/pkgconfig
    version: 0.3.26.dev
  lapack:
    detection method: pkgconfig
    found: true
    include directory: /usr/local/include
    lib directory: /usr/local/lib
    name: openblas
    openblas configuration: USE_64BITINT=0 DYNAMIC_ARCH=1 DYNAMIC_OLDER= NO_CBLAS=
      NO_LAPACK= NO_LAPACKE= NO_AFFINITY=1 USE_OPENMP= SANDYBRIDGE MAX_THREADS=64
    pc file directory: /usr/local/lib/pkgconfig
    version: 0.3.26.dev
  pybind11:
    detection method: config-tool
    include directory: unknown
    name: pybind11
    version: 2.12.0
Compilers:
  c:
    commands: cc
    linker: ld64
    name: clang
    version: 13.0.0
  c++:
    commands: c++
    linker: ld64
    name: clang
    version: 13.0.0
  cython:
    commands: cython
    linker: cython
    name: cython
    version: 3.0.10
  fortran:
    commands: gfortran
    linker: ld64
    name: gcc
    version: 11.3.0
  pythran:
    include directory: ../../../../../../private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-mo36y8b_/overlay/lib/python3.11/site-packages/pythran
    version: 0.15.0
Machine Information:
  build:
    cpu: x86_64
    endian: little
    family: x86_64
    system: darwin
  cross-compiled: false
  host:
    cpu: x86_64
    endian: little
    family: x86_64
    system: darwin
Python Information:
  path: /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/cibw-run-1iia41ej/cp311-macosx_x86_64/build/venv/bin/python
  version: '3.11'
@jonathf jonathf added the defect A clear bug or issue that prevents SciPy from being installed or used as expected label Apr 25, 2024
@j-bowhay
Copy link
Member

cc @h-vetinari

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.special
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@jonathf @tylerjereddy @h-vetinari @j-bowhay and others