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

Add tests for NaN handling #19

Closed
wants to merge 1 commit into from
Closed

Conversation

varon
Copy link
Contributor

@varon varon commented Feb 5, 2023

This PR adds some (failing) tests for NaN handling.

This does work and is standalone, but obviously the tests fail, so do be aware of that prior to merging.

This can either be used as the base branch for other PRs in this series, such as #18 or can be extended here to a complete implementation.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 5, 2023

CodSpeed Performance Report

Merging #19 nan-handling (9bd778d) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 44 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

dev_utils/src/utils.rs Show resolved Hide resolved
dev_utils/src/utils.rs Show resolved Hide resolved
Comment on lines +51 to +59
utils::insert_nans(&mut data, 0.05);
// Test owned vec
let (min, max) = data.argminmax();
assert_eq!(min, 0);
assert_eq!(max, ARRAY_LENGTH - 1);
// Test borrowed vec
let (min, max) = (&data).argminmax();
assert_eq!(min, 0);
assert_eq!(max, ARRAY_LENGTH - 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test passes almost all the time, at least on the architecture I'm using.
This likely has to do with assumptions about the sorting of the data.

tests/argminmax_test.rs Show resolved Hide resolved
tests/argminmax_test.rs Show resolved Hide resolved
dev_utils/Cargo.toml Show resolved Hide resolved
@varon varon marked this pull request as ready for review February 9, 2023 20:39
@jvdd jvdd changed the base branch from main to nans_v3 February 13, 2023 07:56
@varon
Copy link
Contributor Author

varon commented Feb 26, 2023

@jvdd - actions required here?

@jvdd
Copy link
Owner

jvdd commented Feb 28, 2023

Is superseded by #31

For me it is currently fine to not include nan tests in the integration tests, as this is already quite extensively tested in the unit tests.
However, if you want to contribute this, you are always welcome to recycle and submit a new PR! :)

@jvdd jvdd closed this Feb 28, 2023
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.

2 participants