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

fix: list.mean fast path shouldn't produce NaN #15652

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Apr 15, 2024

No description provided.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Apr 15, 2024
@reswqa reswqa closed this Apr 15, 2024
@reswqa reswqa reopened this Apr 15, 2024
@reswqa reswqa marked this pull request as ready for review April 15, 2024 08:19
Copy link

codspeed-hq bot commented Apr 15, 2024

CodSpeed Performance Report

Merging #15652 will not alter performance

Comparing reswqa:list_mean (b705e17) with main (99ab9c0)

Summary

✅ 22 untouched benchmarks

@ritchie46 ritchie46 merged commit 7af0ec3 into pola-rs:main Apr 15, 2024
24 checks passed
@@ -131,10 +131,15 @@ where
.map(|end| {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write this entire thing without unsafe? It feels unnecessary.

if let Some(slice) = values.get(current_offset as usize..*end as usize) {
    if slice.len() == 0 {
        None
    } else {
        sum_slice::<_, S>(slice) / NumCast::from(slice.len()).unwrap(),
    }
} else {
    None
}

@orlp
Copy link
Collaborator

orlp commented Apr 15, 2024

Oh I didn't update my browser before commenting, I'll do it myself as a chore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants