Skip to content

Commit

Permalink
Merge branch 'main' into chex
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkim0 authored Jul 25, 2023
2 parents 86f768b + 28a8c5d commit 1eb0c97
Show file tree
Hide file tree
Showing 22 changed files with 307 additions and 218 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ on:
jobs:
package:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install build dependencies
run: python -m pip install --upgrade pip wheel twine build

- name: Build package
run: python -m build

- name: Check package
run: twine check --strict dist/*.whl
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
# will use ref/SHA that triggered it
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python 3.9
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"

- name: Install hatch
run: |
pip install hatch
python -m pip install --upgrade hatch
- name: Build project for distribution
run: hatch build
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test_linux_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,29 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
- name: Install scvi-tools test dependencies
run: |
pip install ".[dev,pymde,autotune,hub]"
pip install ".[tests]"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
pytest -v --cov --color=yes
- name: Upload coverage
uses: codecov/codecov-action@v3
9 changes: 7 additions & 2 deletions .github/workflows/test_linux_cpu_pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,29 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
- name: Install scvi-tools test dependencies
run: |
pip install --pre ".[dev,pymde,autotune,hub]"
pip install --pre ".[tests]"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
pytest -v --cov --color=yes
- name: Upload coverage
uses: codecov/codecov-action@v3
8 changes: 3 additions & 5 deletions .github/workflows/test_linux_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ jobs:
strategy:
fail-fast: false
matrix:
ubuntu: [latest]
mamba: [latest]
python: ["3.11"]
cuda: ["11"]

container:
image: martinkim0/scvi-tools:ubuntu-${{ matrix.ubuntu }}-mamba-${{ matrix.mamba}}-python-${{ matrix.python }}-cuda-${{ matrix.cuda }}
image: martinkim0/scvi-tools:py${{ matrix.python }}-cu${{ matrix.cuda }}-base
options: --user root --gpus all

steps:
Expand All @@ -30,15 +28,15 @@ jobs:

- name: Install dependencies
run: |
pip install ".[dev,pymde,autotune,hub]"
pip install ".[tests]"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ubuntu
DISPLAY: :42
run: |
pytest -v --cov --color=yes --cuda
pytest -v --cov --color=yes --accelerator cuda --devices auto
- name: Upload coverage
uses: codecov/codecov-action@v3
9 changes: 7 additions & 2 deletions .github/workflows/test_macos_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,29 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
- name: Install scvi-tools test dependencies
run: |
pip install ".[dev,pymde,autotune,hub]"
pip install ".[tests]"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
pytest -v --cov --color=yes
- name: Upload coverage
uses: codecov/codecov-action@v3
9 changes: 7 additions & 2 deletions .github/workflows/test_windows_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,29 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Install dependencies
- name: Install scvi-tools test dependencies
run: |
pip install ".[dev,pymde,autotune,hub]"
pip install ".[tests]"
- name: Test
env:
MPLBACKEND: agg
PLATFORM: ${{ matrix.os }}
DISPLAY: :42
run: |
pytest -v --cov --color=yes
- name: Upload coverage
uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
# https://github.com/jupyterlab/jupyterlab/issues/12675
language_version: "17.9.1"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
rev: v0.0.280
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<img src="https://github.com/scverse/scvi-tools/blob/main/docs/_static/scvi-tools-horizontal.svg?raw=true" width="400" alt="scvi-tools">

[![Stars](https://img.shields.io/github/stars/scverse/scvi-tools?logo=GitHub&color=yellow)](https://github.com/YosefLab/scvi-tools/stargazers)
[![Stars](https://img.shields.io/github/stars/scverse/scvi-tools?logo=GitHub&color=yellow)](https://github.com/scverse/scvi-tools/stargazers)
[![PyPI](https://img.shields.io/pypi/v/scvi-tools.svg)](https://pypi.org/project/scvi-tools)
[![Documentation Status](https://readthedocs.org/projects/scvi/badge/?version=latest)](https://scvi.readthedocs.io/en/stable/?badge=stable)
![Build
Status](https://github.com/scverse/scvi-tools/workflows/scvi-tools/badge.svg)
[![Coverage](https://codecov.io/gh/scverse/scvi-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/YosefLab/scvi-tools)
[![Code
Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![Downloads](https://pepy.tech/badge/scvi-tools)](https://pepy.tech/project/scvi-tools)
[![Project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://scverse.zulipchat.com/)
[![PyPIDownloads](https://pepy.tech/badge/scvi-tools)](https://pepy.tech/project/scvi-tools)
[![CondaDownloads](https://img.shields.io/conda/dn/conda-forge/scvi-tools?logo=Anaconda)](https://anaconda.org/conda-forge/scvi-tools)
[![Docs](https://readthedocs.org/projects/scvi/badge/?version=latest)](https://scvi.readthedocs.io/en/stable/?badge=stable)
[![Build](https://github.com/scverse/scvi-tools/actions/workflows/build.yml/badge.svg)](https://github.com/scverse/scvi-tools/actions/workflows/build.yml/)
[![Coverage](https://codecov.io/gh/scverse/scvi-tools/branch/main/graph/badge.svg)](https://codecov.io/gh/scverse/scvi-tools)
[![Discourse](https://img.shields.io/discourse/posts?color=yellow&logo=discourse&server=https%3A%2F%2Fdiscourse.scverse.org)](https://discourse.scverse.org/)
[![Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://scverse.zulipchat.com/)

[scvi-tools](https://scvi-tools.org/) (single-cell variational inference
tools) is a package for probabilistic modeling and analysis of single-cell omics
Expand Down
11 changes: 11 additions & 0 deletions docs/release_notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,22 @@ is available in the [commit logs](https://github.com/YosefLab/scvi-tools/commits
- Add `load_sparse_tensor` argument in {class}`scvi.data.AnnTorchDataset` for directly
loading SciPy CSR and CSC data structures to their PyTorch counterparts, leading to
faster data loading depending on the sparsity of the data {pr}`2158`.
- Add per-group LFC information to the {meth}`scvi.criticism.PosteriorPredictiveCheck.differential_expression`
method {pr}`2173`. `metrics["diff_exp"]` is now a dictionary where the `summary`
stores the summary dataframe, and the `lfc_per_model_per_group` key stores the
per-group LFC.
- Expose {meth}`torch.save` keyword arguments in {class}`scvi.model.base.BaseModelClass.save`
and {class}`scvi.external.GIMVI.save` {pr}`2200`.
- Add `model_kwargs` and `train_kwargs` arguments to {meth}`scvi.autotune.ModelTuner.fit` {pr}`2203`.

#### Changed

- Replace `sparse` with `sparse_format` argument in {meth}`scvi.data.synthetic_iid`
for increased flexibility over dataset format {pr}`2163`.
- Add per-group LFC information to the {meth}`scvi.criticism.PosteriorPredictiveCheck.differential_expression`
method {pr}`2173`. `metrics["diff_exp"]` is now a dictionary where the `summary`
stores the summary dataframe, and the `lfc_per_model_per_group` key stores the
per-group LFC.

#### Removed

Expand Down
81 changes: 47 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,50 +60,63 @@ dependencies = [


[project.optional-dependencies]
dev = [
"black",
tests = [
"pytest",
"pytest-cov",
"scvi-tools[optional]"
] # dependencies for running the test suite
editing = [
"black",
"flake8",
"scanpy>=1.6",
"loompy>=3.0.6",
"jupyter",
"nbformat",
"nbconvert",
"pre-commit",
"ruff",
"pymde",
"genomepy",
"cellxgene-census"
]
] # dependencies for editing and committing code
dev = ["scvi-tools[editing,tests]"] # dependencies for dev work

docs = [
"docutils>=0.8,!=0.18.*,!=0.19.*",
"sphinx>=4.1",
"ipython",
"sphinx-book-theme>=1.0.1",
"sphinx_copybutton",
"sphinx-design",
"sphinxext-opengraph",
"sphinx-hoverxref",
"sphinxcontrib-bibtex>=1.0.0",
"myst-parser",
"myst-nb",
"sphinx-autodoc-typehints",
]
"docutils>=0.8,!=0.18.*,!=0.19.*", # see https://github.com/scverse/cookiecutter-scverse/pull/205
"sphinx>=4.1",
"ipython",
"sphinx-book-theme>=1.0.1",
"sphinx_copybutton",
"sphinx-design",
"sphinxext-opengraph",
"sphinx-hoverxref",
"sphinxcontrib-bibtex>=1.0.0",
"myst-parser",
"myst-nb",
"sphinx-autodoc-typehints",
] # basic docs dependencies
docsbuild = ["scvi-tools[docs,optional]"] # docs build dependencies

autotune = [
"hyperopt>=0.2",
"ray[tune]>=2.5.0",
"ipython",
"scib-metrics>=0.3",
]
pymde = ["pymde"]
tutorials = ["scanpy", "leidenalg", "python-igraph", "loompy", "scikit-misc", "pynndescent", "pymde", "huggingface_hub", "genomepy"]
hub = ["huggingface_hub"]
regseq = [
"biopython>=1.81",
"genomepy",
]
census = ["cellxgene-census"]
"hyperopt>=0.2",
"ray[tune]>=2.5.0",
"ipython",
"scib-metrics>=0.3",
] # scvi.autotune
census = ["cellxgene-census"] # scvi.data.cellxgene
hub = ["huggingface_hub"] # scvi.hub dependencies
pymde = ["pymde"] # scvi.model.utils.mde dependencies
regseq = ["biopython>=1.81", "genomepy"] # scvi.data.add_dna_sequence
loompy = ["loompy>=3.0.6"] # read loom
scanpy = ["scanpy>=1.6"] # scvi.criticism and read 10x
optional = [
"scvi-tools[autotune,census,hub,loompy,pymde,regseq,scanpy]"
] # all optional user functionality

tutorials = [
"leidenalg",
"pynndescent",
"igraph",
"scikit-misc",
"scvi-tools[optional]",
] # dependencies for all tutorials

all = ["scvi-tools[dev,docs,tutorials]"] # all dependencies

[tool.hatch.build.targets.wheel]
packages = ['scvi']
Expand Down
5 changes: 1 addition & 4 deletions readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ python:
- method: pip
path: .
extra_requirements:
- docs
- pymde
- hub
- autotune
- docsbuild
submodules:
include:
- "docs/tutorials/notebooks"
Expand Down
Loading

0 comments on commit 1eb0c97

Please sign in to comment.