Skip to content

Commit

Permalink
fix: use Union type hint for py3.9 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Jun 10, 2024
1 parent 065789b commit 53e4260
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion strkit/call/allele.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def call_alleles(

gmm_cache = {}

def _get_fitted_gmm(s: NDArray[np.int_] | NDArray[np.float_]) -> Optional[object]:
def _get_fitted_gmm(s: Union[NDArray[np.int_], NDArray[np.float_]]) -> Optional[object]:
if (s_t := tuple(s)) not in gmm_cache:
# Fit Gaussian mixture model to the resampled data
gmm_cache[s_t] = fit_gmm(rng, s, n_alleles, allele_filter, params.hq, gm_filter_factor)
Expand Down
2 changes: 1 addition & 1 deletion strkit/mi/expansionhunter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__all__ = ["ExpansionHunterCalculator"]


def _parse_allele(a: int | str | None) -> int | None:
def _parse_allele(a: Union[int, str, None]) -> int | None:
if isinstance(a, str):
if a == ".":
return None
Expand Down

0 comments on commit 53e4260

Please sign in to comment.