Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/MaxiBoether/s…
Browse files Browse the repository at this point in the history
…igmod-revision-2
  • Loading branch information
MaxiBoether committed Oct 14, 2024
2 parents 0295235 + 6436929 commit fa54ff3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
5 changes: 3 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ disable=raw-checker-failed,
too-many-arguments, # we can't determine a good limit here. reviews should spot bad cases of this.
duplicate-code, # Mostly imports and test setup.
cyclic-import, # We use these inside methods that require models from multiple apps. Tests will catch actual errors.
too-many-instance-attributes, # We always ignore this anyways
too-many-positional-arguments # We do not want to limit the number of positional arguments
too-many-instance-attributes, # We always ignore this anyways
too-many-positional-arguments, # We do not want to limit the number of positional arguments
too-many-locals # We always ignore this anyways
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
Expand Down
2 changes: 1 addition & 1 deletion modyn/selector/internal/grpc/selector_grpc_servicer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(self, selector_manager: SelectorManager, sample_batch_size: int):
self.selector_manager = selector_manager
self._sample_batch_size = sample_batch_size

def get_sample_keys_and_weights( # pylint: disable-next=unused-argument
def get_sample_keys_and_weights( # pylint: disable-next=unused-argument, too-many-locals
self, request: GetSamplesRequest, context: grpc.ServicerContext
) -> Iterable[SamplesResponse]:
pipeline_id, trigger_id, worker_id, partition_id = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
EvaluateModelResponse,
EvaluationAbortedReason,
EvaluationIntervalData,
SingleMetricResult,
)
from modyn.supervisor.internal.eval.strategies.abstract import EvalInterval
from modyn.supervisor.internal.eval.strategies.slicing import SlicingEvalStrategy
Expand Down Expand Up @@ -826,7 +827,12 @@ def get_eval_intervals(
],
)
]
test_get_evaluation_results.return_value = [EvaluationIntervalData() for _ in range(3)]
test_get_evaluation_results.return_value = [
EvaluationIntervalData(
interval_index=idx, evaluation_data=[SingleMetricResult(metric="Accuracy", result=0.5)]
)
for idx in [0, 2]
]

else:
intervals = [
Expand All @@ -851,7 +857,12 @@ def get_eval_intervals(
evaluation_id=42,
interval_responses=[success_interval for _ in range(len(intervals))],
)
test_get_evaluation_results.return_value = [EvaluationIntervalData() for _ in range(len(intervals))]
test_get_evaluation_results.return_value = [
EvaluationIntervalData(
interval_index=idx, evaluation_data=[SingleMetricResult(metric="Accuracy", result=0.5)]
)
for idx in range(len(intervals))
]

pe.grpc.evaluator = evaluator_stub_mock

Expand All @@ -869,7 +880,7 @@ def get_eval_intervals(

assert evaluator_stub_mock.evaluate_model.call_count == 1 # batched
if test_failure:
assert test_cleanup_evaluations.call_count == 1
assert test_cleanup_evaluations.call_count == 2
assert test_wait_for_evaluation_completion.call_count == 1

stage_info = [
Expand Down

0 comments on commit fa54ff3

Please sign in to comment.