From ae112748b8995075ca91037432bd4720158a387a Mon Sep 17 00:00:00 2001 From: Sofia Stamouli Date: Mon, 19 Feb 2024 16:27:37 +0100 Subject: [PATCH] Rename PipelineDeliverables to WorkflowDeliverables --- cg/meta/workflow/nf_analysis.py | 14 +++++++------- cg/meta/workflow/rnafusion.py | 1 - cg/models/nf_analysis.py | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cg/meta/workflow/nf_analysis.py b/cg/meta/workflow/nf_analysis.py index 069080b4aa..ed335ecbcb 100644 --- a/cg/meta/workflow/nf_analysis.py +++ b/cg/meta/workflow/nf_analysis.py @@ -19,7 +19,7 @@ MetricsDeliverablesCondition, ) from cg.models.fastq import FastqFileMeta -from cg.models.nf_analysis import FileDeliverable, PipelineDeliverables +from cg.models.nf_analysis import FileDeliverable, WorkflowDeliverables from cg.models.rnafusion.rnafusion import CommandArgs from cg.utils import Process from cg.store.models import Sample @@ -337,8 +337,8 @@ def get_deliverables_for_sample( files.append(FileDeliverable(**deliverables)) return files - def get_deliverables_for_case(self, case_id: str) -> PipelineDeliverables: - """Return PipelineDeliverables for a given case.""" + def get_deliverables_for_case(self, case_id: str) -> WorkflowDeliverables: + """Return WorkflowDeliverables for a given case.""" deliverable_template: list[dict] = self.get_deliverables_template_content() samples: list[Sample] = self.status_db.get_samples_by_case_id(case_id=case_id) files: list[FileDeliverable] = [] @@ -349,7 +349,7 @@ def get_deliverables_for_case(self, case_id: str) -> PipelineDeliverables: ) files.extend(bundle for bundle in bundles_per_sample if bundle not in files) - return PipelineDeliverables(files=files) + return WorkflowDeliverables(files=files) def get_multiqc_json_path(self, case_id: str) -> Path: """Return the path of the multiqc_data.json file.""" @@ -439,10 +439,10 @@ def validate_qc_metrics(self, case_id: str, dry_run: bool = False) -> None: self.trailblazer_api.set_analysis_status(case_id=case_id, status=AnalysisStatus.COMPLETED) def report_deliver(self, case_id: str) -> None: - """Create deliverables file.""" - deliverables_content: PipelineDeliverables = self.get_deliverables_for_case(case_id=case_id) + """Write deliverables file.""" + workflow_content: WorkflowDeliverables = self.get_deliverables_for_case(case_id=case_id) self.write_deliverables_file( - deliverables_content=deliverables_content.dict(), + deliverables_content=workflow_content.dict(), file_path=self.get_deliverables_file_path(case_id=case_id), ) LOG.info( diff --git a/cg/meta/workflow/rnafusion.py b/cg/meta/workflow/rnafusion.py index bb669260be..c7bc7d26b1 100644 --- a/cg/meta/workflow/rnafusion.py +++ b/cg/meta/workflow/rnafusion.py @@ -15,7 +15,6 @@ from cg.models.cg_config import CGConfig from cg.models.deliverables.metric_deliverables import MetricsBase, MultiqcDataJson from cg.models.fastq import FastqFileMeta -from cg.models.nf_analysis import PipelineDeliverables from cg.models.rnafusion.rnafusion import ( RnafusionAnalysis, RnafusionParameters, diff --git a/cg/models/nf_analysis.py b/cg/models/nf_analysis.py index bc0e856448..06fe623598 100644 --- a/cg/models/nf_analysis.py +++ b/cg/models/nf_analysis.py @@ -58,7 +58,7 @@ def set_path_as_string(cls, file_path: str | Path) -> str | None: return None -class PipelineDeliverables(BaseModel): +class WorkflowDeliverables(BaseModel): """Specification for workflow deliverables.""" files: list[FileDeliverable]