Skip to content

Commit

Permalink
Passed logger instance to two calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Aayush1104 committed Nov 21, 2024
1 parent efbcbd3 commit 571335a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/cluster_estimation/cluster_estimation_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ def cluster_estimation_worker(

assert local_logger is not None

local_logger.info("Logger initialized")

result, estimator = cluster_estimation.ClusterEstimation.create(
min_activation_threshold,
min_new_points_to_run,
random_state,
local_logger,
)
if not result:
local_logger.error("Worker failed to create class object", True)
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_cluster_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from modules.cluster_estimation import cluster_estimation
from modules import detection_in_world
from modules.common.modules.logger import logger


MIN_TOTAL_POINTS_THRESHOLD = 100
Expand All @@ -26,10 +27,15 @@ def cluster_model() -> cluster_estimation.ClusterEstimation: # type: ignore
"""
Cluster estimation object.
"""
result, test_logger = logger.Logger.create("test_logger", False)
assert result
assert test_logger is not None

result, model = cluster_estimation.ClusterEstimation.create(
MIN_TOTAL_POINTS_THRESHOLD,
MIN_NEW_POINTS_TO_RUN,
RNG_SEED,
test_logger,
)
assert result
assert model is not None
Expand Down

0 comments on commit 571335a

Please sign in to comment.