Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
grst committed Mar 18, 2024
1 parent bdca594 commit f2e7d99
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/scirpy/ir_dist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Compute distances between immune receptor sequences"""

import itertools
from collections.abc import Sequence
from typing import Literal, Optional, Union
Expand Down Expand Up @@ -114,7 +115,7 @@ def _ir_dist(
sequence: Literal["aa", "nt"] = "nt",
key_added: Union[str, None] = None,
inplace: bool = True,
n_jobs: Union[int, None] = -1,
n_jobs: int = -1,
airr_mod: str = "airr",
airr_key: str = "airr",
chain_idx_key: str = "chain_indices",
Expand Down Expand Up @@ -247,7 +248,7 @@ def sequence_dist(
*,
metric: MetricType = "identity",
cutoff: Union[None, int] = None,
n_jobs: Union[None, int] = -1,
n_jobs: int = -1,
**kwargs,
) -> csr_matrix:
"""
Expand Down
2 changes: 1 addition & 1 deletion src/scirpy/ir_dist/_clonotype_neighbors.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(
match_columns: Union[None, Sequence[str]] = None,
distance_key: str,
sequence_key: str,
n_jobs: Union[int, None] = None,
n_jobs: int,
chunksize: int = 2000,
):
"""Computes pairwise distances between cells with identical
Expand Down
6 changes: 3 additions & 3 deletions src/scirpy/ir_dist/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(
self,
cutoff: int,
*,
n_jobs: Optional[int] = -1,
n_jobs: int = -1,
block_size: Optional[int] = None,
):
super().__init__(cutoff)
Expand Down Expand Up @@ -444,7 +444,7 @@ def __init__(
self,
cutoff: int = 10,
*,
n_jobs: Union[int, None] = -1,
n_jobs: int = -1,
block_size: Optional[int] = None,
subst_mat: str = "blosum62",
gap_open: int = 11,
Expand Down Expand Up @@ -580,7 +580,7 @@ def __init__(
self,
cutoff: int = 10,
*,
n_jobs: Union[int, None] = None,
n_jobs: int = -1,
block_size: Optional[int] = None,
subst_mat: str = "blosum62",
gap_open: int = 11,
Expand Down
2 changes: 1 addition & 1 deletion src/scirpy/tests/test_ir_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def adata_cdr3_mock_distance_calculator():
"""Mock distances for the adata_cdr3 fixture"""

class MockDistanceCalculator(DistanceCalculator):
def __init__(self, n_jobs=None):
def __init__(self, n_jobs=-1):
pass

def calc_dist_mat(self, seqs, seqs2=None):
Expand Down
2 changes: 1 addition & 1 deletion src/scirpy/tl/_clonotypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def define_clonotype_clusters(
n_iterations: int = 5,
distance_key: Union[str, None] = None,
inplace: bool = True,
n_jobs: Union[int, None] = None,
n_jobs: int = -1,
chunksize: int = 2000,
airr_mod="airr",
airr_key="airr",
Expand Down
2 changes: 1 addition & 1 deletion src/scirpy/tl/_ir_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def ir_query(
key_added: Optional[str] = None,
distance_key: Optional[str] = None,
inplace: bool = True,
n_jobs: Optional[int] = -1,
n_jobs: int = -1,
chunksize: int = 2000,
airr_mod: str = "airr",
airr_key: str = "airr",
Expand Down

0 comments on commit f2e7d99

Please sign in to comment.