Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions modules/cluster_estimation/cluster_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@ class ClusterEstimation:
works by predicting 'cluster centres' from groups of closely placed landing pad
detections.

ATTRIBUTES
----------
min_activation_threshold: int
Minimum total data points before model runs.

min_new_points_to_run: int
Minimum number of new data points that must be collected before running model.

max_num_components: int
Max number of real landing pads.

random_state: int
Seed for randomizer, to get consistent results.

METHODS
-------
run()
Expand Down Expand Up @@ -80,17 +66,35 @@ def create(
) -> "tuple[bool, ClusterEstimation | None]":
"""
Data requirement conditions for estimation model to run.

PARAMETERS:
min_activation_threshold: int
Minimum total data points before model runs. Must be at least 1.

min_new_points_to_run: int
Minimum number of new data points that must be collected before running model. Must be at least 0.

max_num_components: int
Max number of real landing pads. Must be at least 1.

random_state: int
Seed for randomizer, to get consistent results. Must be at least 0.

local_logger: logger.Logger
The local logger to log this object's information.

RETURNS: The ClusterEstimation object if all conditions pass, otherwise False, None
"""
# These parameters must be positive
if min_new_points_to_run < 0 or random_state < 0:
if min_activation_threshold < 1:
return False, None

# At least 1 point for model to fit
if min_activation_threshold < 1:
if min_new_points_to_run < 0:
return False, None

if max_num_components < 1:
return False, None

# This must be greater than 0
if max_num_components < 0:
if random_state < 0:
return False, None

return True, ClusterEstimation(
Expand Down
Loading