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 Jul 8, 2024
1 parent 190d7a9 commit d2ff2e4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
4 changes: 1 addition & 3 deletions src/spVIPES/data/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ def _make_column_categorical(
if np.min(counts) < 3:
category = unique[np.argmin(counts)]
warnings.warn(
"Category {} in adata.obs['{}'] has fewer than 3 cells. Models may not train properly.".format(
category, alternate_column_key
),
f"Category {category} in adata.obs['{alternate_column_key}'] has fewer than 3 cells. Models may not train properly.",
UserWarning,
stacklevel=settings.warnings_stacklevel,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def __init__(
sampler_cls = (
SequentialSampler
if not shuffle and not weighted
else WeightedRandomSampler
if shuffle and weighted
else RandomSampler
if shuffle and not weighted
else None
else (
WeightedRandomSampler
if shuffle and weighted
else RandomSampler if shuffle and not weighted else None
)
)
if sampler_cls != WeightedRandomSampler:
sampler = BatchSampler(
Expand Down
10 changes: 5 additions & 5 deletions src/spVIPES/dataloaders/_ann_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def __init__(
sampler_cls = (
SequentialSampler
if not shuffle and not weighted
else WeightedRandomSampler
if shuffle and weighted
else RandomSampler
if shuffle and not weighted
else None
else (
WeightedRandomSampler
if shuffle and weighted
else RandomSampler if shuffle and not weighted else None
)
)
if sampler_cls != WeightedRandomSampler:
sampler = BatchSampler(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
https://docs.scvi-tools.org/en/0.9.0/user_guide/notebooks/model_user_guide.html#Mixing-in-pre-coded-features
"""


from typing import List, Optional, Union

import numpy as np
Expand Down
1 change: 0 additions & 1 deletion src/spVIPES/model/base/training_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
https://docs.scvi-tools.org/en/0.9.0/user_guide/notebooks/model_user_guide.html#Mixing-in-pre-coded-features
"""


from typing import Optional, Union

import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions src/spVIPES/model/spvipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ def __init__(
)

self._model_summary_string = (
"spVIPES Model with the following params: \nn_hidden: {}, n_dimensions_shared: {}, n_dimensions_private: {}, dropout_rate: {}"
).format(n_hidden, n_dimensions_shared, n_dimensions_private, dropout_rate)
f"spVIPES Model with the following params: \nn_hidden: {n_hidden}, n_dimensions_shared: {n_dimensions_shared}, n_dimensions_private: {n_dimensions_private}, dropout_rate: {dropout_rate}"
)
# necessary line to get params that will be used for saving/loading
self.init_params_ = self._get_init_params(locals())

Expand Down
1 change: 1 addition & 0 deletions src/spVIPES/module/spVIPESmodule.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main module."""

from typing import Literal

import numpy as np
Expand Down

0 comments on commit d2ff2e4

Please sign in to comment.