Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkim0 committed Mar 11, 2024
2 parents 9b05bca + 6062656 commit 8c25dba
Show file tree
Hide file tree
Showing 124 changed files with 2,940 additions and 2,069 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]
pull_request:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Test (Linux)

on:
push:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]
pull_request:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -38,13 +38,10 @@ jobs:
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
run: |
pip install --pre ".[tests]"
python -m pip install --upgrade pip wheel uv
python -m uv pip install --system "scvi-tools[tests] @ ."
- name: Test
env:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test_linux_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test (Linux, CUDA)

on:
pull_request:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]
types: [labeled, synchronize, opened]
schedule:
- cron: "0 10 * * *" # runs at 10:00 UTC (03:00 PST) every day
Expand Down Expand Up @@ -48,7 +48,8 @@ jobs:

- name: Install dependencies
run: |
pip install ".[tests]"
python -m pip install --upgrade pip wheel uv
python -m uv pip install --system "scvi-tools[tests] @ ."
- name: Test
env:
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/test_linux_pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test (Linux, prereleases)

on:
pull_request:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]
types: [labeled, synchronize, opened]
schedule:
- cron: "0 10 * * *" # runs at 10:00 UTC (03:00 PST) every day
Expand Down Expand Up @@ -48,13 +48,10 @@ jobs:
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
run: |
pip install --pre ".[tests]"
python -m pip install --upgrade pip wheel uv
python -m uv pip install --system "scvi-tools[tests] @ ."
- name: Test
env:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test_linux_private.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: Test (Linux, private)

on:
pull_request:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]
types: [labeled, synchronize, opened]
push:
branches: [main, 1.1.x]
branches: [main, 1.1.x, 1.2.x]
schedule:
- cron: "0 10 * * *" # runs at 10:00 UTC (03:00 PST) every day
workflow_dispatch:
Expand Down Expand Up @@ -60,13 +60,10 @@ jobs:
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
run: |
pip install ".[tests]"
python -m pip install --upgrade pip wheel uv
python -m uv pip install --system "scvi-tools[tests] @ ."
- name: Test
env:
Expand Down
24 changes: 5 additions & 19 deletions docs/api/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Parameterizable probability distributions.
:toctree: reference/
:nosignatures:
distributions.Poisson
distributions.NegativeBinomial
distributions.NegativeBinomialMixture
distributions.ZeroInflatedNegativeBinomial
Expand Down Expand Up @@ -124,6 +125,7 @@ These classes should be used to construct user-facing model classes.
model.base.PyroJitGuideWarmup
model.base.PyroModelGuideWarmup
model.base.DifferentialComputation
model.base.EmbeddingMixin
```

## Module
Expand Down Expand Up @@ -197,6 +199,7 @@ These classes should be used to construct module classes that define generative
module.base.BaseMinifiedModeModuleClass
module.base.PyroBaseModuleClass
module.base.JaxBaseModuleClass
module.base.EmbeddingModuleMixin
module.base.LossOutput
module.base.auto_move_data
Expand All @@ -219,7 +222,9 @@ Basic neural network building blocks.
nn.FCLayers
nn.Encoder
nn.Decoder
nn.DecoderSCVI
nn.one_hot
nn.Embedding
```

Expand Down Expand Up @@ -252,25 +257,6 @@ TrainingPlans define train/test/val optimization steps for modules.
```

## Model hyperparameter tuning

`scvi-tools` supports automatic model hyperparameter tuning using [Ray Tune]. These
classes allow for new model classes to be easily integrated with the module.

```{eval-rst}
.. currentmodule:: scvi
```

```{eval-rst}
.. autosummary::
:toctree: reference/
:nosignatures:
autotune.TunerManager
autotune.Tunable
autotune.TunableMixin
```

## Utilities

```{eval-rst}
Expand Down
4 changes: 2 additions & 2 deletions docs/api/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ Here we maintain a few package specific utilities for feature selection, etc.
:toctree: reference/
:nosignatures:
autotune.ModelTuner
autotune.TuneAnalysis
autotune.run_autotune
autotune.AutotuneExperiment
```

## Model hub
Expand Down
42 changes: 41 additions & 1 deletion docs/release_notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,47 @@ is available in the [commit logs](https://github.com/scverse/scvi-tools/commits/
[keep a changelog]: https://keepachangelog.com/en/1.0.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

### 1.1.1 (unreleased)
### 1.2.0 (unreleased)

#### Added

- Add new experimental functional API for hyperparameter tuning with
{func}`scvi.autotune.run_autotune` and {class}`scvi.autotune.AutotuneExperiment` to replace
{class}`scvi.autotune.ModelTuner`, {class}`scvi.autotune.TunerManager`, and
{class}`scvi.autotune.TuneAnalysis` {pr}`2561`.
- Add experimental class {class}`scvi.nn.Embedding` implementing methods for extending embeddings
{pr}`2574`.
- Add experimental support for representing batches with continuously-valued embeddings by passing
in `batch_representation="embedding"` to {class}`scvi.model.SCVI` {pr}`2576`.
- Add experimental mixin classes {class}`scvi.model.base.EmbeddingMixin` and
{class}`scvi.module.base.EmbeddingModuleMixin` {pr}`2576`.
- Add option to generate synthetic spatial coordinates in {func}`scvi.data.synthetic_iid` with
argument `generate_coordinates` {pr}`2603`.
- Add experimental support for using custom {class}`lightning.pytorch.core.LightningDataModule`s
in {func}`scvi.autotune.run_autotune` {pr}`2605`.

#### Changed

- Deprecate {func}`scvi.data.cellxgene`, to be removed in v1.3. Please directly use the
[cellxgene-census](https://chanzuckerberg.github.io/cellxgene-census/) instead {pr}`2542`.

#### Removed

- Remove {class}`scvi.autotune.ModelTuner`, {class}`scvi.autotune.TunerManager`, and
{class}`scvi.autotune.TuneAnalysis` in favor of new experimental functional API with
{func}`scvi.autotune.run_autotune` and {class}`scvi.autotune.AutotuneExperiment` {pr}`2561`.

### 1.1.2 (2024-03-01)

#### Changed

- Address AnnData >= 0.10 deprecation warning for {func}`anndata.read` by replacing instances with
{func}`anndata.read_h5ad` {pr}`2531`.
- Address AnnData >= 0.10 deprecation warning for {class}`anndata._core.sparse_dataset.SparseDataset`
by replacing instances with {class}`anndata.experimental.CSCDataset` and
{class}`anndata.experimental.CSRDataset` {pr}`2531`.

### 1.1.1 (2024-02-19)

#### Fixed

Expand Down
28 changes: 11 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires = ["hatchling"]

[project]
name = "scvi-tools"
version = "1.1.1"
version = "1.1.2"
description = "Deep probabilistic analysis of single-cell omics data."
readme = "README.md"
requires-python = ">=3.9"
Expand Down Expand Up @@ -59,7 +59,7 @@ dependencies = [
[project.optional-dependencies]
tests = [
"pytest",
"pytest-cov",
"coverage",
"scvi-tools[optional]"
] # dependencies for running the test suite
editing = [
Expand Down Expand Up @@ -89,8 +89,6 @@ docsbuild = ["scvi-tools[docs,optional]"] # docs build dependencies
autotune = [
"hyperopt>=0.2",
"ray[tune]>=2.5.0,<2.10.0",
"ipython",
"scib-metrics>=0.4.1",
"tensorboard",
] # scvi.autotune
aws = ["boto3"] # scvi.hub.HubModel.pull_from_s3
Expand Down Expand Up @@ -182,10 +180,6 @@ select = [
"RUF100", # Report unused noqa directives
]
ignore = [
# line too long -> we accept long comment lines; black gets rid of long code lines
"E501",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
# allow I, O, l as variable names -> I is the identity matrix
"E741",
# Missing docstring in public package
Expand All @@ -207,10 +201,17 @@ ignore = [
"D203",
# We want docstrings to start immediately after the opening triple quote
"D213",
# Missing argument description in the docstring TODO: enable
"D417",
]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.per-file-ignores]
"docs/*" = ["I", "BLE001"]
"tests/*" = ["D"]
"*/__init__.py" = ["F401"]
"scvi/__init__.py" = ["I"]

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
Expand All @@ -224,14 +225,7 @@ skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.ruff.pydocstyle]
convention = "numpy"

[tool.ruff.per-file-ignores]
"docs/*" = ["I", "BLE001"]
"tests/*" = ["D"]
"*/__init__.py" = ["F401"]
"scvi/__init__.py" = ["I"]

[tool.jupytext]
formats = "ipynb,md"
3 changes: 1 addition & 2 deletions scvi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import warnings

from ._constants import METRIC_KEYS, REGISTRY_KEYS
from ._constants import REGISTRY_KEYS
from ._settings import settings

# this import needs to come after prior imports to prevent circular import
Expand All @@ -25,7 +25,6 @@
__all__ = [
"settings",
"REGISTRY_KEYS",
"METRIC_KEYS",
"data",
"model",
"external",
Expand Down
14 changes: 0 additions & 14 deletions scvi/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,4 @@ class _REGISTRY_KEYS_NT(NamedTuple):
OBSERVED_LIB_SIZE: str = "observed_lib_size"


class _METRIC_KEYS_NT(NamedTuple):
TRAINING_KEY: str = "training"
VALIDATION_KEY: str = "validation"
# classification
ACCURACY_KEY: str = "accuracy"
F1_SCORE_KEY: str = "f1_score"
CALIBRATION_ERROR_KEY: str = "calibration_error"
AUROC_KEY: str = "auroc"
CLASSIFICATION_LOSS_KEY: str = "classification_loss"
TRUE_LABELS_KEY: str = "true_labels"
LOGITS_KEY: str = "logits"


REGISTRY_KEYS = _REGISTRY_KEYS_NT()
METRIC_KEYS = _METRIC_KEYS_NT()
11 changes: 0 additions & 11 deletions scvi/_decorators.py

This file was deleted.

Loading

0 comments on commit 8c25dba

Please sign in to comment.