Skip to content

Commit

Permalink
Rename methods
Browse files Browse the repository at this point in the history
  • Loading branch information
islean committed Jan 10, 2025
1 parent 50cd756 commit d256586
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions cg/services/order_validation_service/rules/sample/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
)
from cg.services.order_validation_service.rules.sample.utils import (
PlateSamplesValidator,
does_contain_multiple_applications,
does_contain_multiple_priorities,
get_indices_for_repeated_sample_names,
get_indices_for_tube_repeated_container_name,
has_multiple_applications,
has_multiple_priorities,
is_container_name_missing,
is_invalid_well_format,
is_invalid_well_format_rml,
Expand Down Expand Up @@ -256,7 +256,7 @@ def validate_pools_contain_one_application(
errors: list[PoolApplicationError] = []
for pool, enumerated_samples in order.enumerated_pools.items():
samples: list[IndexedSample] = [sample for _, sample in enumerated_samples]
if does_contain_multiple_applications(samples):
if has_multiple_applications(samples):
for sample_index, _ in enumerated_samples:
error = PoolApplicationError(sample_index=sample_index, pool_name=pool)
errors.append(error)
Expand All @@ -269,7 +269,7 @@ def validate_pools_contain_one_priority(
errors: list[PoolPriorityError] = []
for pool, enumerated_samples in order.enumerated_pools.items():
samples: list[IndexedSample] = [sample for _, sample in enumerated_samples]
if does_contain_multiple_priorities(samples):
if has_multiple_priorities(samples):
for sample_index, _ in enumerated_samples:
error = PoolPriorityError(sample_index=sample_index, pool_name=pool)
errors.append(error)
Expand Down
4 changes: 2 additions & 2 deletions cg/services/order_validation_service/rules/sample/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def validate_concentration_required(order: FastqOrder) -> list[ConcentrationRequ
return errors


def does_contain_multiple_applications(samples: list[IndexedSample]) -> bool:
def has_multiple_applications(samples: list[IndexedSample]) -> bool:
return len({sample.application for sample in samples}) > 1


def does_contain_multiple_priorities(samples: list[IndexedSample]) -> bool:
def has_multiple_priorities(samples: list[IndexedSample]) -> bool:
return len({sample.priority for sample in samples}) > 1

0 comments on commit d256586

Please sign in to comment.