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

Adding statistical functions #102

Merged
merged 31 commits into from
Aug 7, 2020
Merged

Conversation

kevloui
Copy link
Contributor

@kevloui kevloui commented Jul 31, 2020

No description provided.

@kevloui
Copy link
Contributor Author

kevloui commented Jul 31, 2020

Thank you for the fixes!

Copy link
Member

@alecmocatta alecmocatta left a comment

Choose a reason for hiding this comment

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

Remember to add the user-facing .mean() method in par_pipe.rs and par_stream.rs

Copy link
Member

@alecmocatta alecmocatta left a comment

Choose a reason for hiding this comment

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

.mean() needs to be exposed as a user-facing function in par_stream dn par_sink

@kevloui
Copy link
Contributor Author

kevloui commented Aug 5, 2020

Added .stddev() and split stats.rs into mean.rs and stddev.rs for clarity.

@kevloui kevloui force-pushed the master branch 3 times, most recently from 85709f1 to 57998dc Compare August 5, 2020 14:04
@kevloui
Copy link
Contributor Author

kevloui commented Aug 5, 2020

Changes to stddev.rs for pooled SD. General cleanup.

Copy link
Member

@alecmocatta alecmocatta left a comment

Choose a reason for hiding this comment

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

Clippy gives a bunch of cast_precision_loss warnings. Could you possibly use these two methods in place of as to fix this?

#[allow(
	clippy::cast_possible_truncation,
	clippy::cast_sign_loss,
	clippy::cast_precision_loss
)]
fn u64_to_f64(x: u64) -> f64 {
	assert_eq!(x, x as f64 as u64);
	x as f64
}
#[allow(
	clippy::cast_possible_truncation,
	clippy::cast_sign_loss,
	clippy::cast_precision_loss,
	clippy::float_cmp
)]
fn f64_to_u64(x: f64) -> u64 {
	assert_eq!(x, x as u64 as f64);
	x as u64
}

To be extra neat perhaps you could put these in amadeus-core/src/util.rs and adjust amadeus-core/src/file/local.rs to use them as well?

@mergify mergify bot dismissed alecmocatta’s stale review August 6, 2020 21:56

Pull request has been modified.

@alecmocatta alecmocatta merged commit b397d67 into constellation-rs:master Aug 7, 2020
kevloui added a commit to kevloui/amadeus that referenced this pull request Aug 7, 2020
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