Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve pylance issue with subscription of dict #1187

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions cases_import/models/executors.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def _import_externalfile(
fa = external_file.file_attributes
if fa.get("designation") != "quality_control":
return # can only handle QC data here
file_identifier_to_individual: dict[str, str] = {
file_identifier_to_individual: typing.Dict[str, str] = {
v: k for k, v in (external_file.identifier_map or {}).items()
}

Expand All @@ -230,7 +230,7 @@ def _import_dragen_qc_cnv_metrics(
self,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
with self.external_fs.open(external_file.path, "rt") as inputf:
io_dragen.load_cnv_metrics(
Expand All @@ -244,7 +244,7 @@ def _import_dragen_qc_fragment_length_hist(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -260,7 +260,7 @@ def _import_dragen_qc_mapping_metrics(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -276,7 +276,7 @@ def _import_dragen_qc_ploidy_estimation_metrics(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -292,7 +292,7 @@ def _import_dragen_qc_roh_metrics(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -307,7 +307,7 @@ def _import_dragen_qc_sv_metrics(
self,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
with self.external_fs.open(external_file.path, "rt") as inputf:
io_dragen.load_sv_metrics(
Expand All @@ -321,7 +321,7 @@ def _import_dragen_qc_time_metrics(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -337,7 +337,7 @@ def _import_dragen_qc_trimmer_metrics(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -352,7 +352,7 @@ def _import_dragen_qc_vc_hethom_ratio_metrics(
self,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
with self.external_fs.open(external_file.path, "rt") as inputf:
io_dragen.load_vc_hethom_ratio_metrics(
Expand All @@ -365,7 +365,7 @@ def _import_dragen_qc_vc_metrics(
self,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
with self.external_fs.open(external_file.path, "rt") as inputf:
io_dragen.load_vc_metrics(
Expand All @@ -379,7 +379,7 @@ def _import_dragen_qc_wgs_contig_mean_cov(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -395,7 +395,7 @@ def _import_dragen_qc_wgs_coverage_metrics(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -411,7 +411,7 @@ def _import_dragen_qc_wgs_fine_hist(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -427,7 +427,7 @@ def _import_dragen_qc_wgs_hist(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -443,7 +443,7 @@ def _import_dragen_qc_wgs_overall_mean_cov(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -459,7 +459,7 @@ def _import_dragen_qc_region_coverage_metrics(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
region_name = external_file.file_attributes.get("region_name", "UNKNOWN REGION")
Expand All @@ -477,7 +477,7 @@ def _import_dragen_qc_region_coverage_fine_hist(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
region_name = external_file.file_attributes.get("region_name", "UNKNOWN REGION")
Expand All @@ -495,7 +495,7 @@ def _import_dragen_qc_region_coverage_hist(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
region_name = external_file.file_attributes.get("region_name", "UNKNOWN REGION")
Expand All @@ -513,7 +513,7 @@ def _import_dragen_qc_region_coverage_overall_mean_cov(
individual_name: str,
external_file: IndividualExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
region_name = external_file.file_attributes.get("region_name", "UNKNOWN REGION")
Expand All @@ -530,7 +530,7 @@ def _import_samtools_qc_bcftools_stats(
self,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
with self.external_fs.open(external_file.path, "rt") as inputf:
io_samtools.load_bcftools_stats(
Expand All @@ -544,7 +544,7 @@ def _import_samtools_qc_samtools_flagstat(
individual_name: str,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -560,7 +560,7 @@ def _import_samtools_qc_samtools_idxstats(
individual_name: str,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -576,7 +576,7 @@ def _import_samtools_qc_samtools_stats(
individual_name: str,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -592,7 +592,7 @@ def _import_cramino_qc_cramino(
individual_name: str,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
with self.external_fs.open(external_file.path, "rt") as inputf:
Expand All @@ -608,7 +608,7 @@ def _import_ngsbits_qc_mappingqc(
individual_name: str,
external_file: PedigreeExternalFile,
caseqc: CaseQc,
file_identifier_to_individual: dict[str, str] | None = None,
file_identifier_to_individual: typing.Dict[str, str] | None = None,
):
sample_name = external_file.identifier_map.get(individual_name, individual_name)
region_name = external_file.file_attributes.get("region_name", "UNKNOWN REGION")
Expand Down
2 changes: 1 addition & 1 deletion cases_qc/io/cramino.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def load_cramino(
sample: str,
input_file: typing.TextIO,
caseqc: models.CaseQc,
file_identifier_to_individual: dict[str, str],
file_identifier_to_individual: typing.Dict[str, str],
) -> cases_qc.models.cramino.CraminoMetrics:
"""Load a ``cramino`` output file into a ``cases_qc.models.CraminoMetrics`` record."""
parser = CraminoParser()
Expand Down
Loading