Skip to content

Commit

Permalink
Merge pull request #432 from JuliaKukulies/n_min_thresholds_docs
Browse files Browse the repository at this point in the history
updated docstrings for n_min_threshold
  • Loading branch information
JuliaKukulies authored Aug 14, 2024
2 parents 57612ec + 5551fb7 commit 7d7503e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions tobac/feature_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def feature_detection_threshold(
] = "center",
sigma_threshold: float = 0.5,
n_erosion_threshold: int = 0,
n_min_threshold: int = 0,
n_min_threshold: Union[int, dict[float, int], list[int]] = 0,
min_distance: float = 0,
idx_start: int = 0,
PBC_flag: Literal["none", "hdim_1", "hdim_2", "both"] = "none",
Expand Down Expand Up @@ -428,8 +428,10 @@ def feature_detection_threshold(
Number of pixels by which to erode the identified features.
Default is 0.
n_min_threshold : int, optional
n_min_threshold : int, dict of float to int, or list of int, optional
Minimum number of identified contiguous pixels for a feature to be detected. Default is 0.
If given as a list, the number of elements must match number of thresholds.
If given as a dict, the keys need to match the thresholds and the values are the minimum number of identified contiguous pixels for a feature using that specific threshold.
min_distance : float, optional
Minimum distance between detected features (in meters). Default is 0.
Expand Down Expand Up @@ -897,7 +899,7 @@ def feature_detection_multithreshold_timestep(
] = "center",
sigma_threshold: float = 0.5,
n_erosion_threshold: int = 0,
n_min_threshold: int = 0,
n_min_threshold: Union[int, dict[float, int], list[int]] = 0,
min_distance: float = 0,
feature_number_start: int = 1,
PBC_flag: Literal["none", "hdim_1", "hdim_2", "both"] = "none",
Expand Down Expand Up @@ -944,8 +946,10 @@ def feature_detection_multithreshold_timestep(
Number of pixels by which to erode the identified features.
Default is 0.
n_min_threshold : int, optional
n_min_threshold : int, dict of float to int, or list of int, optional
Minimum number of identified contiguous pixels for a feature to be detected. Default is 0.
If given as a list, the number of elements must match number of thresholds.
If given as a dict, the keys need to match the thresholds and the values are the minimum number of identified contiguous pixels for a feature using that specific threshold.
min_distance : float, optional
Minimum distance between detected features (in meters). Default is 0.
Expand Down Expand Up @@ -1026,7 +1030,7 @@ def feature_detection_multithreshold_timestep(
):
raise ValueError(
"Ambiguous input for threshold values. If n_min_threshold is given as a dict,"
" the keys not to correspond to the values in threshold."
" the keys must correspond to the values in threshold."
)
# sort dictionary by keys (threshold values) so that they match sorted thresholds and
# get values for n_min_threshold
Expand Down Expand Up @@ -1139,7 +1143,7 @@ def feature_detection_multithreshold(
] = "center",
sigma_threshold: float = 0.5,
n_erosion_threshold: int = 0,
n_min_threshold: int = 0,
n_min_threshold: Union[int, dict[float, int], list[int]] = 0,
min_distance: float = 0,
feature_number_start: int = 1,
PBC_flag: Literal["none", "hdim_1", "hdim_2", "both"] = "none",
Expand Down Expand Up @@ -1184,8 +1188,10 @@ def feature_detection_multithreshold(
Number of pixels by which to erode the identified features.
Default is 0.
n_min_threshold : int, optional
n_min_threshold : int, dict of float to int, or list of int, optional
Minimum number of identified contiguous pixels for a feature to be detected. Default is 0.
If given as a list, the number of elements must match number of thresholds.
If given as a dict, the keys need to match the thresholds and the values are the minimum number of identified contiguous pixels for a feature using that specific threshold.
min_distance : float, optional
Minimum distance between detected features (in meters). Default is 0.
Expand Down

0 comments on commit 7d7503e

Please sign in to comment.