Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ae4be03

Browse files
committedOct 25, 2024
make format of docs for single checks more consistent
1 parent 2b7b442 commit ae4be03

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed
 

‎src/checks/single/range_check.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use crate::{DataCache, Flag};
22

3-
/// QC test that checks whether each observation fits within given (inclusive) limits.
3+
/// Single check of whether an observation fits within given (inclusive) limits.
44
///
5-
/// If the observation is missing, Flag::DataMissing with be returned, else if it is outside the
6-
/// upper or lower limits, Flag::Fail, else Flag::Pass.
5+
/// Returns:
6+
/// - [`Flag::DataMissing`] if the observation is missing,
7+
/// - [`Flag::Fail`] if it is outside the upper or lower limits,
8+
/// - [`Flag::Pass`] otherwise.
79
pub fn range_check(datum: Option<f32>, lower_limit: f32, upper_limit: f32) -> Flag {
810
match datum {
911
None => Flag::DataMissing,

‎src/checks/single/range_check_humidity.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ use crate::{DataCache, Flag};
22

33
/// Range check with a correction for humidity over 100%.
44
///
5-
/// Humidity less than 5% or greater than 105% returns Flag::Fail, between 100% and 105% it is,
6-
/// corrected down to 100%.
5+
/// Returns:
6+
/// - ([`Flag::DataMissing`], None) if the observation is missing,
7+
/// - ([`Flag::Fail`], None) if humidity less than 5% or greater than 105%,
8+
/// - ([`Flag::Warn`], Some(100.)) between 100% and 105%,
9+
/// - ([`Flag::Pass`], None) otherwise.
710
pub fn range_check_humidity(datum: Option<f32>) -> (Flag, Option<f32>) {
811
match datum {
912
None => (Flag::DataMissing, None),

‎src/checks/single/range_check_wind_direction.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ use crate::{DataCache, Flag};
22

33
/// Range check with a correction for wind direction outside 0-360.
44
///
5-
/// If the direction is -20-0, or 360-380, 360 will be added or subtracted to get it back into
6-
/// the correct range.
5+
/// Returns:
6+
/// - ([`Flag::DataMissing`], None) if the observation is missing,
7+
/// - ([`Flag::Fail`], None) if the value is less than -20 or greater than 380,
8+
/// - ([`Flag::Warn`], Some(value + 360)) if the value is between -20 and 0,
9+
/// - ([`Flag::Warn`], Some(value - 360)) if the value is between 360 and 380,
10+
/// - ([`Flag::Pass`], None) otherwise.
711
pub fn range_check_wind_direction(datum: Option<f32>) -> (Flag, Option<f32>) {
812
// TODO: get to the bottom of weird -3.0 handling: kvalobs code looks for a value -3.0, and
913
// avoids flagging that if X_5 (lowest?) is also -3.0. From comments in the code, it looks like

‎src/checks/single/special_values_check.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use crate::{DataCache, Flag};
22

3-
/// QC test that checks whether each observation matches some special values.
3+
/// Single check of whether an observation matches some special values.
44
///
5-
/// If the observation is missing, Flag::DataMissing with be returned, else if it is matches any of
6-
/// the special values, Flag::Fail, else Flag::Pass.
5+
/// Returns:
6+
/// - [`Flag::DataMissing`] if the observation is missing,
7+
/// - [`Flag::Fail`] if it matches any of the special values
8+
/// - [`Flag::Pass`] otherwise.
79
pub fn special_values_check(datum: Option<f32>, special_values: &[f32]) -> Flag {
810
match datum {
911
None => Flag::DataMissing,

0 commit comments

Comments
 (0)
Please sign in to comment.