Skip to content

Commit aea3e8f

Browse files
committed
rename parameter nums_min to min_buddies in buddy_check for aesthetics
1 parent 1f50931 commit aea3e8f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/checks/spatial/buddy_check.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct BuddyCheckArgs {
1010
/// Search radius in which buddies of an observation will be found. Unit: m
1111
pub radii: SingleOrVec<f32>,
1212
/// The minimum buddies an observation can have (lest it be flagged [`Flag::Isolated`])
13-
pub nums_min: SingleOrVec<u32>,
13+
pub min_buddies: SingleOrVec<u32>,
1414
/// The variance threshold for flagging a station. Unit: σ (standard deviations)
1515
pub threshold: f32,
1616
/// The maximum difference in elevation for a buddy (if negative will not check for height
@@ -30,7 +30,7 @@ pub struct BuddyCheckArgs {
3030
///
3131
/// The check looks for buddies of an observation (at index i) in a neighbourhood specified by
3232
/// `radii[i]` \[m\], which is the radius of a circle around the observation to be checked. A minimum
33-
/// number of observations (`nums_min[i]`) is required to be available inside the circle and the
33+
/// number of observations (`min_buddies[i]`) is required to be available inside the circle and the
3434
/// range of elevations in the circle must not exceed `max_elev_diff` meters . The number of
3535
/// iterations is set by `num_iterations`.
3636
///
@@ -89,7 +89,7 @@ pub fn buddy_check(
8989

9090
let mut list_buddies: Vec<f32> = Vec::new();
9191

92-
if neighbours.len() >= *args.nums_min.index(i) as usize {
92+
if neighbours.len() >= *args.min_buddies.index(i) as usize {
9393
for neighbour in neighbours {
9494
let (_, _, neighbour_elev) = rtree.get_coords_at_index(neighbour.data);
9595

@@ -115,7 +115,7 @@ pub fn buddy_check(
115115
}
116116
}
117117

118-
if list_buddies.len() >= *args.nums_min.index(i) as usize {
118+
if list_buddies.len() >= *args.min_buddies.index(i) as usize {
119119
let mean: f32 = list_buddies.iter().sum::<f32>() / list_buddies.len() as f32;
120120
let variance: f32 = (list_buddies.iter().map(|x| x.powi(2)).sum::<f32>()
121121
/ list_buddies.len() as f32)
@@ -217,7 +217,7 @@ mod tests {
217217
),
218218
&BuddyCheckArgs {
219219
radii: SingleOrVec::Single(10000.),
220-
nums_min: SingleOrVec::Single(1),
220+
min_buddies: SingleOrVec::Single(1),
221221
threshold: 1.,
222222
max_elev_diff: 200.,
223223
elev_gradient: -0.0065,

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! ),
1818
//! &BuddyCheckArgs {
1919
//! radii: SingleOrVec::Single(10000.),
20-
//! nums_min: SingleOrVec::Single(1),
20+
//! min_buddies: SingleOrVec::Single(1),
2121
//! threshold: 1.,
2222
//! max_elev_diff: 200.,
2323
//! elev_gradient: -0.0065,

0 commit comments

Comments
 (0)