Skip to content

feat: add any() and all() logical reduction methods - #29

Merged
CodeWithKyrian merged 1 commit into
mainfrom
feat/logical-reductions-any-all
Jun 9, 2026
Merged

CodeWithKyrian merged 1 commit into
mainfrom
feat/logical-reductions-any-all

Conversation

@CodeWithKyrian

Copy link
Copy Markdown
Contributor

This PR adds any() and all() boolean reduction methods to NDArray

Motivation and Context

These were the last missing basic reduction operations. any() and all() are fundamental for boolean array evaluation — checking conditions, validating constraints, and filtering logic. They were tracked in SPEC.md as unimplemented items 8.2.1 and 8.2.2.

What's Changed

  • Two new Rust FFI modules (any.rs, all.rs) with scalar and axis reduction functions
  • any(?int $axis = null, bool $keepdims = false): bool|NDArray — tests whether any element is true
  • all(?int $axis = null, bool $keepdims = false): bool|NDArray — tests whether all elements are true
  • 31 test cases covering scalar, axis, keepdims, float, int, bool data, 3D arrays
  • Updated SPEC.md, statistics API reference, and NumPy migration guide

Breaking Changes

None.

@CodeWithKyrian
CodeWithKyrian merged commit c1ddba4 into main Jun 9, 2026
14 checks passed
@CodeWithKyrian
CodeWithKyrian deleted the feat/logical-reductions-any-all branch June 9, 2026 11:19
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