Skip to content

Clarify scalar return types for nansum - #635

Open
Boulea7 wants to merge 1 commit into
pydata:masterfrom
Boulea7:docs/nansum-scalar-dtype
Open

Boulea7 wants to merge 1 commit into
pydata:masterfrom
Boulea7:docs/nansum-scalar-dtype

Conversation

@Boulea7

@Boulea7 Boulea7 commented Dec 3, 2026

Copy link
Copy Markdown

The nansum reference says the output always has the input dtype. A full reduction of native-endian float32 input returns a Python float, even when the caller specifies axis=0 on a one-dimensional array. The input precision still controls accumulation. For example, [2**24, 1, -2**24] sums to 0.0 with float32 input and 1.0 with float64 input.

The docstring now describes scalar and array results for the four accelerated dtypes. It also identifies full reductions in the Returns section. This follows the documentation change discussed in #185.

I built the extension, rendered the function reference with Sphinx, and compared scalar and array results with Bottleneck 1.6.1 and the base commit. The package suite reported 208 passes and one expected failure.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant