Skip to content

Commit 10a514f

Browse files
Fix Mypy type errors
1 parent 2d251d4 commit 10a514f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

malariagen_data/anoph/snp_frq.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import allel # type: ignore
55
import numpy as np
6+
import numpy.typing as npt
67
import pandas as pd
78
from numpydoc_decorator import doc # type: ignore
89
import xarray as xr
@@ -518,8 +519,8 @@ def snp_allele_frequencies_advanced(
518519

519520
# Set up main event variables.
520521
n_variants, n_cohorts = len(variant_position), len(df_cohorts)
521-
count = np.zeros((n_variants, n_cohorts), dtype=int)
522-
nobs = np.zeros((n_variants, n_cohorts), dtype=int)
522+
count: npt.NDArray[np.float64] = np.zeros((n_variants, n_cohorts), dtype=int)
523+
nobs: npt.NDArray[np.float64] = np.zeros((n_variants, n_cohorts), dtype=int)
523524

524525
# Build event count and nobs for each cohort.
525526
cohorts_iterator = self._progress(

tests/anoph/test_hap_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def test_haplotypes_virtual_contigs(
605605

606606
# Test with region.
607607
seq = api.genome_sequence(region=chrom)
608-
start, stop = sorted(np.random.randint(low=1, high=len(seq), size=2))
608+
start, stop = sorted(map(int, np.random.randint(low=1, high=len(seq), size=2)))
609609
region = f"{chrom}:{start:,}-{stop:,}"
610610

611611
# Standard checks.

0 commit comments

Comments
 (0)