Skip to content

Commit

Permalink
Remove commented-out code
Browse files Browse the repository at this point in the history
  • Loading branch information
ahdamin committed Oct 8, 2024
1 parent 9348379 commit 42fcf3e
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions genotype_api/services/endpoint_services/sample_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 42fcf3e

Please sign in to comment.