Skip to content

Support NumPy vector initials in accumulate - #643

Open
mikamikasuki wants to merge 1 commit into
pytoolz:masterfrom
mikamikasuki:fix/accumulate-array-initial
Open

mikamikasuki wants to merge 1 commit into
pytoolz:masterfrom
mikamikasuki:fix/accumulate-array-initial

Conversation

@mikamikasuki

Copy link
Copy Markdown

Problem: accumulate(np.add, values, initial=np.zeros(2)) raises ValueError before producing a result because the initial vector is compared with the string sentinel.

Fix: Check the reserved sentinel only for strings and UserString, allowing NumPy vector initials while preserving existing string-sentinel behavior.

Validation: 272 tests/doctests and 19 benchmarks passed, plus style and pre-commit. The NumPy regression ran locally; it skips when NumPy is unavailable.

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