Skip to content

feat: Add BatchNanMin, BatchNanMax, and BatchNanPeakToPeak#11

Merged
CyrilJl merged 1 commit into
mainfrom
add-nan-stats
Aug 13, 2025
Merged

feat: Add BatchNanMin, BatchNanMax, and BatchNanPeakToPeak#11
CyrilJl merged 1 commit into
mainfrom
add-nan-stats

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

This PR adds support for BatchNanMin, BatchNanMax, and BatchNanPeakToPeak to handle batch statistical calculations while ignoring NaN values.

This commit introduces three new NaN-aware statistical classes:
- `BatchNanMin`: for calculating the minimum of batches of data, ignoring NaNs.
- `BatchNanMax`: for calculating the maximum of batches of data, ignoring NaNs.
- `BatchNanPeakToPeak`: for calculating the peak-to-peak (max - min) of batches of data, ignoring NaNs.

The implementation follows the existing structure of the library. `BatchNanMin` and `BatchNanMax` are implemented similarly to their non-NaN counterparts, but using `np.nanmin` and `np.nanmax` respectively. `BatchNanPeakToPeak` is implemented by composing `BatchNanMin` and `BatchNanMax`.

This commit also includes:
- Unit tests for the new classes.
- Updates to the documentation and README to include the new classes.
@CyrilJl CyrilJl marked this pull request as ready for review August 13, 2025 08:36
@CyrilJl CyrilJl merged commit 0c1ca47 into main Aug 13, 2025
2 checks passed
@CyrilJl CyrilJl deleted the add-nan-stats branch April 11, 2026 14:43
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