Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #1317 on branch 0.14.x (update black version) #1324

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 22.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@


# General information about the project.
project = u"scvi-tools"
copyright = u"2021, Yosef Lab, UC Berkeley"
author = u"Romain Lopez, Adam Gayoso, Pierre Boyeau, Galen Xing"
project = "scvi-tools"
copyright = "2021, Yosef Lab, UC Berkeley"
author = "Romain Lopez, Adam Gayoso, Pierre Boyeau, Galen Xing"

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version = "0.14.5"

[tool.poetry.dependencies]
anndata = ">=0.7.5"
black = {version = ">=20.8b1", optional = true}
black = {version = ">=22.1", optional = true}
codecov = {version = ">=2.0.8", optional = true}
docrep = ">=0.3.2"
flake8 = {version = ">=3.7.7", optional = true}
Expand Down Expand Up @@ -70,6 +70,7 @@ sphinx-panels = {version = "*", optional = true}
sphinx-tabs = {version = "*", optional = true}
sphinx_copybutton = {version = "<=0.3.1", optional = true}
torch = ">=1.8.0"
torchmetrics = ">=0.6.0"
tqdm = ">=4.56.0"
typing_extensions = {version = "*", python = "<3.8", optional = true}

Expand Down
2 changes: 1 addition & 1 deletion scvi/distributions/_negative_binomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def mean(self):

@property
def variance(self):
return self.mean + (self.mean ** 2) / self.theta
return self.mean + (self.mean**2) / self.theta

def sample(
self, sample_shape: Union[torch.Size, Tuple] = torch.Size()
Expand Down
2 changes: 1 addition & 1 deletion scvi/model/_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def nearest_neighbor_overlap(x1, x2, k=100):
set_2 = set(np.where(kmatrix_2.A.flatten() == 1)[0])
fold_enrichment = (
len(set_1.intersection(set_2))
* n_samples ** 2
* n_samples**2
/ (float(len(set_1)) * len(set_2))
)
return spearman_correlation, fold_enrichment
Expand Down
2 changes: 1 addition & 1 deletion scvi/model/_totalvi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ def _get_totalvi_protein_priors(adata, batch_mask, n_cells=100):

# average distribution over cells
batch_avg_mu = np.mean(mus)
batch_avg_scale = np.sqrt(np.sum(np.square(scales)) / (n_cells ** 2))
batch_avg_scale = np.sqrt(np.sum(np.square(scales)) / (n_cells**2))

batch_avg_mus.append(batch_avg_mu)
batch_avg_scales.append(batch_avg_scale)
Expand Down
2 changes: 1 addition & 1 deletion scvi/module/_amortizedlda.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def logistic_normal_approximation(
"""
K = alpha.shape[0]
mu = torch.log(alpha) - torch.log(alpha).sum() / K
sigma = torch.sqrt((1 - 2 / K) / alpha + torch.sum(1 / alpha) / K ** 2)
sigma = torch.sqrt((1 - 2 / K) / alpha + torch.sum(1 / alpha) / K**2)
return mu, sigma


Expand Down
2 changes: 1 addition & 1 deletion scvi/module/_multivae.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def inference(

## Sample from the average distribution
qzp_m = (qzm_acc + qzm_expr) / 2
qzp_v = (qzv_acc + qzv_expr) / (2 ** 0.5)
qzp_v = (qzv_acc + qzv_expr) / (2**0.5)
zp = Normal(qzp_m, qzp_v.sqrt()).rsample()

## choose the correct latent representation based on the modality
Expand Down