Skip to content

Commit

Permalink
adding basedpyright
Browse files Browse the repository at this point in the history
  • Loading branch information
nrminor committed Nov 12, 2024
1 parent 10cc45a commit beb2811
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions bin/resplice_primers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ def dedup_primers(partitioned_bed: list[pl.DataFrame]) -> list[pl.DataFrame]:


def resolve_primer_names(
to_combine: list[str],
combine_to: list[str],
combine_from: list[str],
combine_onto: list[str],
) -> tuple[list[str], list[str]]:
"""
`resolve_primer_names()` names each possible pairing of primers in
Expand All @@ -144,15 +144,15 @@ def resolve_primer_names(
a list of new primer names to use once left-joining is complete.
"""

primer_pairs = list(product(to_combine, combine_to))
primer_pairs = list(product(combine_from, combine_onto))

new_primer_pairs = []
for fwd_primer, rev_primer in primer_pairs:
fwd_suffix = fwd_primer.split("_")[-1]
rev_suffix = rev_primer.split("_")[-1]
primer_label = fwd_primer.replace(f"_{fwd_suffix}", "").split("-")[-1]
try:
int(primer_label)
_ = int(primer_label)
except TypeError:
primer_label = "1"
amplicon = "_".join(
Expand All @@ -175,7 +175,6 @@ def resolve_primer_names(
return (primers_to_join, new_primer_names)


@logger.catch
def resplice_primers(
dedup_partitioned: list[pl.DataFrame],
fwd_suffix: str,
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ bedtools = ">=2.31.1,<3"

[tool.uv]
dev-dependencies = [
"basedpyright>=1.21.0",
"ipykernel>=6.29.5",
"ipython>=8.12.3",
"jupyter>=0.6.4",
Expand All @@ -111,6 +112,7 @@ dev-dependencies = [
]
compile-bytecode = true

[tool.pyright]
[tool.basedpyright]
venvPath = "."
venv = ".venv"
typeCheckingMode = "basic"

0 comments on commit beb2811

Please sign in to comment.