Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Sebastian review

Co-authored-by: Sebastian Diaz <[email protected]>
  • Loading branch information
ChrOertlin and diitaz93 authored Dec 18, 2024
1 parent f8356e4 commit ba9c4f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions cg/services/deliver_files/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
class DeliveryServiceFactory:
"""
Class to build the delivery services based on case, workflow, delivery type, delivery destination and delivery structure.
The delivery destination is used to specify delivery to the customer or for upload.
The delivery destination is used to specify delivery to the customer or for external upload.
It determines how the delivery_base_path is managed and its underlying folder structure.
Delivery type is used to specify the type of delivery to perform.
Delivery structure is used to specify the structure of the delivery.
Expand Down Expand Up @@ -176,10 +176,10 @@ def _get_file_fetcher(
)

def _convert_workflow(self, case: Case) -> Workflow:
"""Converts a workflow with the introduction of the microbial-fastq delivery type an
unsupported combination of delivery type and workflow setup is required. This function
makes sure that a raw data workflow with microbial fastq delivery type is treated as a
microsalt workflow so that the microbial-fastq sample files can be concatenated.
"""Change the workflow of a Microbial Fastq case to Microsalt to allow the concatenation of fastq files.
With the introduction of the microbial-fastq delivery type, an unsupported combination of delivery type and
workflow setup is required. This function makes sure that a raw data workflow with microbial fastq delivery
type is treated as a microsalt workflow so that the microbial-fastq sample files can be concatenated.
args:
case: The case to convert the workflow for
"""
Expand Down Expand Up @@ -296,7 +296,7 @@ def build_delivery_service(
"""Build a delivery service based on a case.
args:
case: The case to deliver files for.
delivery_type: The type of delivery to perform.
delivery_type: The type of data delivery to perform. See DataDelivery enum for explanation.
delivery_destination: The destination of the delivery defaults to customer. See DeliveryDestination enum for explanation.
delivery_structure: The structure of the delivery defaults to nested. See DeliveryStructure enum for explanation.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _fetch_files(
self, service_class: type, case_id: str, sample_id: str | None
) -> DeliveryFiles:
"""Fetch files using the provided service class.
Wrapper to fetch files using the provided service class this is either the RawDataDeliveryFileFetcher or the AnalysisDeliveryFileFetcher.
Wrapper to fetch files using the provided service class. This is either the RawDataDeliveryFileFetcher or the AnalysisDeliveryFileFetcher.
args:
service_class: The service class to use to fetch the files
case_id: The case id to fetch files for
Expand Down
3 changes: 2 additions & 1 deletion cg/services/deliver_files/file_fetcher/analysis_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def get_files_to_deliver(self, case_id: str, sample_id: str | None = None) -> De
def _validate_delivery_has_content(delivery_files: DeliveryFiles) -> DeliveryFiles:
"""
Check if the delivery files has files to deliver.
raise NoDeliveryFilesError if no files to deliver.
raises:
NoDeliveryFilesError if no files to deliver.
args:
delivery_files: The delivery files to check
"""
Expand Down
3 changes: 2 additions & 1 deletion cg/services/deliver_files/file_fetcher/raw_data_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def get_files_to_deliver(self, case_id: str, sample_id: str | None = None) -> De
@staticmethod
def _validate_delivery_has_content(delivery_files: DeliveryFiles) -> DeliveryFiles:
"""Check if the delivery files has files to deliver.
raise NoDeliveryFilesError if no files to deliver.
raises:
NoDeliveryFilesError if no files to deliver.
args:
delivery_files: The delivery files to check
"""
Expand Down

0 comments on commit ba9c4f5

Please sign in to comment.