Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 1, 2024
1 parent 6e68fa5 commit a1b1cf1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/scvi/external/methylvi/_module.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""PyTorch module for methylVI for single cell methylation data."""

from collections.abc import Iterable
from typing import Literal, Optional
from typing import Literal

import torch
import torch.nn as nn
Expand Down Expand Up @@ -57,7 +57,7 @@ def __init__(
contexts: Iterable[str],
num_features_per_context: Iterable[int],
n_batch: int = 0,
n_cats_per_cov: Optional[Iterable[int]] = None,
n_cats_per_cov: Iterable[int] | None = None,
n_hidden: int = 128,
n_latent: int = 10,
n_layers: int = 1,
Expand Down Expand Up @@ -89,7 +89,7 @@ def __init__(
)

self.decoders = nn.ModuleDict()
for context, num_features in zip(contexts, num_features_per_context):
for context, num_features in zip(contexts, num_features_per_context, strict=False):
self.decoders[context] = DecoderMETHYLVI(
n_latent,
num_features,
Expand All @@ -102,7 +102,9 @@ def __init__(
self.px_gamma = torch.nn.ParameterDict(
{
context: nn.Parameter(torch.randn(num_features))
for (context, num_features) in zip(contexts, num_features_per_context)
for (context, num_features) in zip(
contexts, num_features_per_context, strict=False
)
}
)

Expand Down
7 changes: 3 additions & 4 deletions src/scvi/external/methylvi/_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
from typing import Optional, Union

import numpy as np

Expand All @@ -12,9 +11,9 @@

def scmc_raw_counts_properties(
adata_manager: AnnDataManager,
idx1: Union[list[int], np.ndarray],
idx2: Union[list[int], np.ndarray],
var_idx: Optional[Union[list[int], np.ndarray]] = None,
idx1: list[int] | np.ndarray,
idx2: list[int] | np.ndarray,
var_idx: list[int] | np.ndarray | None = None,
context: str = None,
) -> dict[str, np.ndarray]:
"""Computes and returns some statistics on the raw counts of two sub-populations.
Expand Down

0 comments on commit a1b1cf1

Please sign in to comment.