From 42fcf3e9f2c639591cac1e477a68ca3e5d057f03 Mon Sep 17 00:00:00 2001 From: ahdamin Date: Tue, 8 Oct 2024 11:30:00 +0200 Subject: [PATCH] Remove commented-out code --- .../endpoint_services/sample_service.py | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/genotype_api/services/endpoint_services/sample_service.py b/genotype_api/services/endpoint_services/sample_service.py index 6acb0d4..025c350 100644 --- a/genotype_api/services/endpoint_services/sample_service.py +++ b/genotype_api/services/endpoint_services/sample_service.py @@ -4,14 +4,23 @@ from typing import Literal from genotype_api.constants import Sexes, Types -from genotype_api.database.filter_models.sample_models import SampleFilterParams, SampleSexesUpdate +from genotype_api.database.filter_models.sample_models import ( + SampleFilterParams, + SampleSexesUpdate, +) from genotype_api.database.models import Analysis, Sample from genotype_api.dto.genotype import GenotypeResponse from genotype_api.dto.sample import AnalysisOnSample, SampleCreate, SampleResponse -from genotype_api.exceptions import GenotypeDBError, InsufficientAnalysesError, SampleNotFoundError +from genotype_api.exceptions import ( + GenotypeDBError, + InsufficientAnalysesError, + SampleNotFoundError, +) from genotype_api.models import MatchResult, SampleDetail from genotype_api.services.endpoint_services.base_service import BaseService -from genotype_api.services.match_genotype_service.match_genotype import MatchGenotypeService +from genotype_api.services.match_genotype_service.match_genotype import ( + MatchGenotypeService, +) class SampleService(BaseService): @@ -115,21 +124,11 @@ async def get_match_results( analysis_type=comparison_set, date_min=date_min, date_max=date_max ) - # if not analyses: - # raise InsufficientAnalysesError - # Fetch the sample analysis with eager loading sample_analysis = await self.store.get_analysis_by_type_and_sample_id( sample_id=sample_id, analysis_type=analysis_type ) - # if sample_analysis is None: - # raise SampleNotFoundError - - # # Ensure that genotypes are eagerly loaded to avoid lazy loading - # if not sample_analysis.genotypes: - # raise GenotypeDBError - # Perform matching using the MatchGenotypeService matches: list[MatchResult] = MatchGenotypeService.get_matches( analyses=analyses, sample_analysis=sample_analysis