Updates for 0.4.0

This commit is contained in:
sharkdp authored and David Peter committed 2018-01-28 18:49:54 +01:00
1 parent 2e24ff012a
commit 89e6d37562
7 files changed
+24 -23

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@ pub fn mean_shell_spawning_time(style: &OutputStyleOption) -> io::Result<TimingR
fn run_preparation_command(command: &Option<String>) -> io::Result<()> {
if let &Some(ref preparation_command) = command {
let res = time_shell_command(preparation_command, CmdFailureAction::RaiseError, None);
if let Err(_) = res {
if res.is_err() {
return Err(io::Error::new(
io::ErrorKind::Other,
"The preparation command terminated with a non-zero exit code. \
+8 -8
View File
@@ -62,16 +62,16 @@ impl Default for HyperfineOptions {
/// Return a pre-configured progress bar
pub fn get_progress_bar(length: u64, msg: &str, option: &OutputStyleOption) -> ProgressBar {
let progressbar_style = match option {
&OutputStyleOption::Basic => ProgressStyle::default_bar(),
&OutputStyleOption::Full => ProgressStyle::default_spinner()
.tick_chars("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏")
.template(" {spinner} {msg:<30} {wide_bar} ETA {eta_precise}"),
let progressbar_style = match *option {
OutputStyleOption::Basic => ProgressStyle::default_bar(),
OutputStyleOption::Full => ProgressStyle::default_spinner()
.tick_chars("⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏")
.template(" {spinner} {msg:<30} {wide_bar} ETA {eta_precise}"),
};
let progress_bar = match option {
&OutputStyleOption::Basic => ProgressBar::hidden(),
&OutputStyleOption::Full => ProgressBar::new(length),
let progress_bar = match *option {
OutputStyleOption::Basic => ProgressBar::hidden(),
OutputStyleOption::Full => ProgressBar::new(length),
};
progress_bar.set_style(progressbar_style.clone());
progress_bar.enable_steady_tick(80);
+4 -4
View File
@@ -13,16 +13,16 @@ use statistical::median;
pub const OUTLIER_THRESHOLD: f64 = 1.4826 * 10.0;
/// Compute modifized Z-scores for a given sample. A (unmodified) Z-score is defined by
/// (x_i - x_mean)/x_stddev whereas the modified Z-score is defined by |x_i - x_median|/MAD where
/// MAD is the median average deviation.
/// `(x_i - x_mean)/x_stddev` whereas the modified Z-score is defined by `|x_i - x_median|/MAD`
/// where MAD is the median average deviation.
///
/// References:
/// - https://en.wikipedia.org/wiki/Median_absolute_deviation
/// - <https://en.wikipedia.org/wiki/Median_absolute_deviation>
pub fn modified_zscores(xs: &[f64]) -> Vec<f64> {
assert!(!xs.is_empty());
// Compute sample median:
let x_median = median(&xs);
let x_median = median(xs);
// Compute the absolute deviations from the median:
let deviations: Vec<f64> = xs.iter().map(|x| (x - x_median).abs()).collect();
+3 -3
View File
@@ -107,9 +107,9 @@ fn main() {
.value_name("TYPE")
.possible_values(&["auto", "basic", "full"])
.help(
"Set output style type. If set to 'basic', all colors and special \
formatting will be disabled. If set to 'auto' when output target is not \
a TTY, 'basic' is used (default: auto).",
"Set output style type (default: auto). Set this to 'basic' to disable output \
coloring and interactive elements. Set it to 'full' to enable all effects \
even if no interactive terminal was detected.",
),
)
.arg(