Skip to content

Commit 5e5424b

Browse files
committed
make format of docs for consistency checks more consistent
1 parent ae4be03 commit 5e5424b

6 files changed

+36
-26
lines changed

src/checks/consistency/greater_than.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ use crate::Flag;
33
/// Consistency check between 2 climate parameters, where one (including a correction) should
44
/// never be greater than the other.
55
///
6-
/// Returns [`Flag::DataMissing`] if either datum is missing,
7-
/// [`Flag::Fail`] if datum1 + datum1_correction > datum2,
8-
/// [`Flag::Pass`] otherwise.
6+
/// Returns:
7+
/// - [`Flag::DataMissing`] if either datum is missing,
8+
/// - [`Flag::Fail`] if datum1 + datum1_correction > datum2,
9+
/// - [`Flag::Pass`] otherwise.
910
pub fn greater_than(datum1: Option<f32>, datum2: Option<f32>, datum1_correction: f32) -> Flag {
1011
if datum1.is_none() || datum2.is_none() {
1112
return Flag::DataMissing;

src/checks/consistency/max_greater_than_single.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use crate::Flag;
33
/// Compares a single value to a higher resolution sequence, where the maximum value in the
44
/// sequence (including an adjustment) should never be greater than the single value
55
///
6-
/// If this invariant is broken (i.e the maximum of the sequence, plus the adjustment, is greater
7-
/// than the single value), we return [`Flag::Fail`].
8-
/// Else, if any of the elements is missing, we return [`Flag::DataMissing`], as we cannot be sure
9-
/// a missing data point did not violate the invariant.
10-
/// Else we return [`Flag::Pass`].
6+
/// Returns:
7+
/// - [`Flag::DataMissing`] if the single value is missing,
8+
/// - [`Flag::Fail`] if this invariant is broken (i.e the maximum of the sequence, plus the
9+
/// adjustment, is greater than the single value),
10+
/// - [`Flag::DataMissing`] if any of the elements is missing, as we cannot be sure a missing data
11+
/// point did not violate the invariant.
12+
/// - [`Flag::Pass`] otherwise.
1113
pub fn max_greater_than_single(
1214
single: Option<f32>,
1315
sequence: &[Option<f32>],

src/checks/consistency/max_less_than_single.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use crate::Flag;
33
/// Compares a single value to a higher resolution sequence, where the maximum value in the
44
/// sequence (including an adjustment) should never be less than the single value
55
///
6-
/// If this invariant is broken (i.e the maximum of the sequence, plus the adjustment, is less
7-
/// than the single value), we return [`Flag::Fail`].
8-
/// Else, if any of the elements is missing, we return [`Flag::DataMissing`], as we cannot be sure
9-
/// a missing data point did not violate the invariant.
10-
/// Else we return [`Flag::Pass`].
6+
/// Returns:
7+
/// - [`Flag::DataMissing`] if the single value is missing,
8+
/// - [`Flag::Fail`] if this invariant is broken (i.e the maximum of the sequence, plus the
9+
/// adjustment, is less than the single value),
10+
/// - [`Flag::DataMissing`] if any of the elements is missing, as we cannot be sure a missing data
11+
/// point did not violate the invariant.
12+
/// - [`Flag::Pass`] otherwise.
1113
pub fn max_less_than_single(
1214
single: Option<f32>,
1315
sequence: &[Option<f32>],

src/checks/consistency/min_greater_than_single.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use crate::Flag;
33
/// Compares a single value to a higher resolution sequence, where the minimum value in the
44
/// sequence (including an adjustment) should never be greater than the single value
55
///
6-
/// If this invariant is broken (i.e the minimum of the sequence, plus the adjustment, is greater
7-
/// than the single value), we return [`Flag::Fail`].
8-
/// Else, if any of the elements is missing, we return [`Flag::DataMissing`], as we cannot be sure
9-
/// a missing data point did not violate the invariant.
10-
/// Else we return [`Flag::Pass`].
6+
/// Returns:
7+
/// - [`Flag::DataMissing`] if the single value is missing,
8+
/// - [`Flag::Fail`] if this invariant is broken (i.e the minimum of the sequence, plus the
9+
/// adjustment, is greater than the single value),
10+
/// - [`Flag::DataMissing`] if any of the elements is missing, as we cannot be sure a missing data
11+
/// point did not violate the invariant.
12+
/// - [`Flag::Pass`] otherwise.
1113
pub fn min_greater_than_single(
1214
single: Option<f32>,
1315
sequence: &[Option<f32>],

src/checks/consistency/min_less_than_single.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ use crate::Flag;
33
/// Compares a single value to a higher resolution sequence, where the minimum value in the
44
/// sequence (including an adjustment) should never be less than the single value
55
///
6-
/// If this invariant is broken (i.e the minimum of the sequence, plus the adjustment, is less
7-
/// than the single value), we return [`Flag::Fail`].
8-
/// Else, if any of the elements is missing, we return [`Flag::DataMissing`], as we cannot be sure
9-
/// a missing data point did not violate the invariant.
10-
/// Else we return [`Flag::Pass`].
6+
/// Returns:
7+
/// - [`Flag::DataMissing`] if the single value is missing,
8+
/// - [`Flag::Fail`] if this invariant is broken (i.e the minimum of the sequence, plus the
9+
/// adjustment, is less than the single value),
10+
/// - [`Flag::DataMissing`] if any of the elements is missing, as we cannot be sure a missing data
11+
/// point did not violate the invariant.
12+
/// - [`Flag::Pass`] otherwise.
1113
pub fn min_less_than_single(
1214
single: Option<f32>,
1315
sequence: &[Option<f32>],

src/checks/consistency/not_equal.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ use crate::Flag;
66
/// Useful for comparing observations against model data, or comparing two instruments measuring
77
/// the same climate parameter at the same site.
88
///
9-
/// Returns [`Flag::DataMissing`] if either datum is missing,
10-
/// [`Flag::Fail`] if the difference between datum1 and datum2 is greater than threshold,
11-
/// [`Flag::Pass`] otherwise.
9+
/// Returns:
10+
/// - [`Flag::DataMissing`] if either datum is missing,
11+
/// - [`Flag::Fail`] if the difference between datum1 and datum2 is greater than threshold,
12+
/// - [`Flag::Pass`] otherwise.
1213
pub fn not_equal(datum1: Option<f32>, datum2: Option<f32>, threshold: f32) -> Flag {
1314
if datum1.is_none() || datum2.is_none() {
1415
return Flag::DataMissing;

0 commit comments

Comments
 (0)