Skip to content

Commit

Permalink
fix pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxiBoether committed Sep 24, 2024
1 parent 8efde93 commit b255971
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
23 changes: 8 additions & 15 deletions modyn/selector/internal/grpc/selector_grpc_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,11 @@ def get_sample_keys_and_weights( # pylint: disable-next=unused-argument
tid = threading.get_native_id()
pid = os.getpid()

logger.info(
"[%s][%s][Pipeline %s]: Fetching samples for trigger id %s and worker id %s and partition id %s",
pid,
tid,
pipeline_id,
trigger_id,
worker_id,
partition_id,
_logmsg = (
f"[{pid}][{tid}][Pipeline {pipeline_id}]: Fetching samples for trigger id {trigger_id}"
+ f" and worker id {worker_id} and partition id {partition_id}"
)
logger.info(_logmsg)

samples = self.selector_manager.get_sample_keys_and_weights(pipeline_id, trigger_id, worker_id, partition_id)

Expand Down Expand Up @@ -94,14 +90,11 @@ def inform_data_and_trigger(self, request: DataInformRequest, context: grpc.Serv
pipeline_id, keys, timestamps, labels = request.pipeline_id, request.keys, request.timestamps, request.labels
tid = threading.get_native_id()
pid = os.getpid()
logger.info(
"[%s][%s][Pipeline %s]: Selector is informed of %s new data points + trigger at timestamp %s",
pid,
tid,
pipeline_id,
len(keys),
timestamps[-1] if keys else "n/a",
_lgmsg = (
f"[{pid}][{tid}][Pipeline {pipeline_id}]: Selector is informed of {len(keys)} new data points"
+ f"+ trigger at timestamp {timestamps[-1] if len(keys) > 0 else 'n/a'}"
)
logger.info(_lgmsg)

trigger_id, log = self.selector_manager.inform_data_and_trigger(pipeline_id, keys, timestamps, labels)
return TriggerResponse(trigger_id=trigger_id, log=JsonString(value=json.dumps(log)))
Expand Down
4 changes: 2 additions & 2 deletions modyn/supervisor/internal/triggers/datadrifttrigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ def _run_detection(
drift_results[metric_name].is_drift = self.decision_policies[metric_name].evaluate_decision(
metric_result.distance
)

logger.info("[DataDriftDetector][Dataset %s][Result] %s", self.dataloader_info.dataset_id, drift_results)
_logmsg = f"[DataDriftDetector][Dataset {self.dataloader_info.dataset_id}]" + f"[Result] {drift_results}"
logger.info(_logmsg)
if is_warmup:
return False, {}

Expand Down

0 comments on commit b255971

Please sign in to comment.