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 Feb 5, 2024
1 parent b1ff7e1 commit b378479
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions velovi/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class VELOVI(VAEMixin, UnsupervisedTrainingMixin, BaseModelClass):
Use a linear decoder from latent space to time.
**model_kwargs
Keyword args for :class:`~velovi.VELOVAE`
"""

def __init__(
Expand Down Expand Up @@ -163,6 +164,7 @@ def train(
`train()` will overwrite values present in `plan_kwargs`, when appropriate.
**trainer_kwargs
Other keyword args for :class:`~scvi.train.Trainer`.
"""
user_plan_kwargs = plan_kwargs.copy() if isinstance(plan_kwargs, dict) else {}
plan_kwargs = {"lr": lr, "weight_decay": weight_decay, "optimizer": "AdamW"}
Expand Down Expand Up @@ -236,6 +238,7 @@ def get_state_assignment(
-------
If `n_samples` > 1 and `return_mean` is False, then the shape is `(samples, cells, genes)`.
Otherwise, shape is `(cells, genes)`. In this case, return type is :class:`~pandas.DataFrame` unless `return_numpy` is True.
"""
adata = self._validate_anndata(adata)
scdl = self._make_data_loader(
Expand Down Expand Up @@ -340,6 +343,7 @@ def get_latent_time(
-------
If `n_samples` > 1 and `return_mean` is False, then the shape is `(samples, cells, genes)`.
Otherwise, shape is `(cells, genes)`. In this case, return type is :class:`~pandas.DataFrame` unless `return_numpy` is True.
"""
adata = self._validate_anndata(adata)
if indices is None:
Expand Down Expand Up @@ -482,6 +486,7 @@ def get_velocity(
-------
If `n_samples` > 1 and `return_mean` is False, then the shape is `(samples, cells, genes)`.
Otherwise, shape is `(cells, genes)`. In this case, return type is :class:`~pandas.DataFrame` unless `return_numpy` is True.
"""
adata = self._validate_anndata(adata)
if indices is None:
Expand Down Expand Up @@ -656,6 +661,7 @@ def get_expression_fit(
-------
If `n_samples` > 1 and `return_mean` is False, then the shape is `(samples, cells, genes)`.
Otherwise, shape is `(cells, genes)`. In this case, return type is :class:`~pandas.DataFrame` unless `return_numpy` is True.
"""
adata = self._validate_anndata(adata)

Expand Down Expand Up @@ -811,6 +817,7 @@ def get_gene_likelihood(
-------
If `n_samples` > 1 and `return_mean` is False, then the shape is `(samples, cells, genes)`.
Otherwise, shape is `(cells, genes)`. In this case, return type is :class:`~pandas.DataFrame` unless `return_numpy` is True.
"""
adata = self._validate_anndata(adata)
scdl = self._make_data_loader(
Expand Down Expand Up @@ -917,6 +924,7 @@ def setup_anndata(
Returns
-------
%(returns)s
"""
setup_method_args = cls._get_setup_method_args(**locals())
anndata_fields = [
Expand Down Expand Up @@ -967,6 +975,7 @@ def get_permutation_scores(
-------
Tuple of DataFrame and AnnData. DataFrame is genes by cell types with score per cell type.
AnnData is the permutated version of the original AnnData.
"""
adata = self._validate_anndata(adata)
adata_manager = self.get_anndata_manager(adata)
Expand Down Expand Up @@ -1090,6 +1099,7 @@ def _directional_statistics_per_cell(
----------
tensor
Shape of samples by genes for a given cell.
"""
n_samples = tensor.shape[0]
# over samples axis
Expand Down
3 changes: 3 additions & 0 deletions velovi/_module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main module."""

from typing import Callable, Iterable, Literal, Optional

import numpy as np
Expand Down Expand Up @@ -44,6 +45,7 @@ class DecoderVELOVI(nn.Module):
Whether to use layer norm in layers
linear_decoder
Whether to use linear decoder for time
"""

def __init__(
Expand Down Expand Up @@ -183,6 +185,7 @@ class VELOVAE(BaseModuleClass):
var_activation
Callable used to ensure positivity of the variational distributions' variance.
When `None`, defaults to `torch.exp`.
"""

def __init__(
Expand Down
1 change: 1 addition & 0 deletions velovi/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def preprocess_data(
Returns
-------
Preprocessed adata.
"""
if min_max_scale:
scaler = MinMaxScaler()
Expand Down

0 comments on commit b378479

Please sign in to comment.