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

Release 0.2.5 #934

Merged
merged 77 commits into from Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
2de8719
Add .editorconfig (#529)
WeilerP Jul 13, 2021
ab5234c
Add TestCleanObsNames (#530)
WeilerP Jul 13, 2021
5ca7e7a
Refactor `clean_obs_names` (#532)
WeilerP Jul 14, 2021
ba75c4a
Move unit tests to `tests/` (#535)
WeilerP Jul 17, 2021
9e6ed69
Fix and refactor `filter_genes` (#537)
WeilerP Jul 20, 2021
04819f6
Add column generation for adata.obs/.var (#544)
WeilerP Jul 22, 2021
639309d
Add unit tests for `cleanup` (#548)
WeilerP Jul 22, 2021
b2a7e84
Fix TestCleanup::test_cleanup_some (#550)
WeilerP Jul 22, 2021
0564ad0
Refactor `cleanup` (#552)
WeilerP Jul 22, 2021
95521f4
Add `TestGetInitialSize` (#554)
WeilerP Jul 23, 2021
a676157
Add `TestGetSize` (#556)
WeilerP Jul 23, 2021
5f3c3fc
Refactor module import (#560)
WeilerP Jul 28, 2021
a668ab8
Update `get_modality` (#567)
WeilerP Jul 29, 2021
8bfe139
Refactor and generalize `get_size` (#569)
WeilerP Jul 29, 2021
1fab0ac
Add TestObsDf (#579)
WeilerP Jul 30, 2021
2a2f594
Add TestVarDf (#583)
WeilerP Jul 30, 2021
fb41567
Update TestObsDf (#585)
WeilerP Jul 30, 2021
dc42b77
Fix typo in default layer names (#587)
WeilerP Jul 30, 2021
afad3b2
Add `TestShowProportions` (#589)
WeilerP Jul 30, 2021
8dc17b0
Add `TestSetInitialSize` (#591)
WeilerP Aug 2, 2021
1596003
Reduce maximum number of obs/vars (#593)
WeilerP Aug 2, 2021
f8448a6
Update ci.yml (#546)
WeilerP Aug 2, 2021
82b0d42
Update `.gitignore` [ci skip] (#595)
WeilerP Aug 2, 2021
115a382
Update `_anndata.py` (#596)
WeilerP Aug 2, 2021
5cc161f
Fix TestShowProportions (#598)
WeilerP Aug 2, 2021
2b40a6b
Update `TestCleanObsNames` (#600)
WeilerP Aug 2, 2021
44d4085
Test modality passed as string (#602)
WeilerP Aug 2, 2021
de9a1fd
Fix `test_not_existing_modality` (#605)
WeilerP Aug 2, 2021
0c3dd3a
Refactor unit test for `l2_norm` (#607)
WeilerP Aug 2, 2021
1b5ff3a
Add `varm` to AnnData strategy (#609)
WeilerP Aug 3, 2021
28a0bc8
Add `TestMerge` (#611)
WeilerP Aug 3, 2021
0673498
Update `TestVarDf` (#615)
WeilerP Aug 4, 2021
13d0d3c
Catch error in steady state calculation (#614)
WeilerP Aug 4, 2021
37c5a66
Fix AnnData strategy (#616)
WeilerP Aug 4, 2021
8905b97
Update `TestSplicingDynamics` (#618)
WeilerP Aug 4, 2021
6462924
Fix `TestCleanup` (#620)
WeilerP Aug 4, 2021
02af560
Update `DynamicsBase` (#622)
WeilerP Aug 4, 2021
8fae9c6
Add `TestGetDf` (#624)
WeilerP Aug 5, 2021
21140a0
Add module `datasets` (#636)
WeilerP Aug 16, 2021
8dbc8ea
Cleanup `datasets/_datasets.py` (#638)
WeilerP Aug 16, 2021
2adbf9d
Fix `DeprecationWarning` [ci skip] (#640)
WeilerP Aug 18, 2021
40a5f11
Add argument `file_path` (#642)
WeilerP Aug 18, 2021
0e89515
Fix gillespie simulation (#644)
WeilerP Aug 18, 2021
f4a6c2e
Add unit tests for `scvelo.datasets` (#646)
WeilerP Aug 18, 2021
782db1d
Merge latest version of `theislab/release/0.2.4`
WeilerP Aug 23, 2021
9ecd812
Merge `theislab/master` into `theislab/develop`
WeilerP Aug 30, 2021
68496bd
Add new datasets to `datasets/__init__.py` (#677)
WeilerP Aug 31, 2021
5407fc3
Fix `csr_vcorrcoef` (#679)
WeilerP Sep 1, 2021
e986468
Update Python versions in CI (#680)
WeilerP Sep 1, 2021
78695fa
Fix and unit test `get_mean_var` (#698)
WeilerP Sep 15, 2021
9ff8098
Add unit tests for `preprocessing/utils.py` (#700)
WeilerP Sep 16, 2021
2899e94
Update AnnData generation for testing (#785)
WeilerP Dec 27, 2021
4add9a2
Add `pull_request_template.md` [ci skip] (#787)
WeilerP Dec 27, 2021
cfcad9f
Speed up CI (#789)
WeilerP Dec 27, 2021
d2ce697
Refactor `neighbors` (#795)
WeilerP Jan 3, 2022
697c115
Fix `_get_rep` (#797)
WeilerP Jan 4, 2022
057b2d4
Refactor testing in CI (#801)
WeilerP Jan 5, 2022
45d85e2
Increase Hypothesis deadline in CI (#804)
WeilerP Jan 5, 2022
bc1e16a
Unit test `neighbors.py` (#799)
WeilerP Jan 5, 2022
bc4cdf0
Unit test `moments.py` (#806)
WeilerP Jan 6, 2022
22f426d
Update `docs/` [ci skip] (#810)
ivirshup Mar 14, 2022
b9893ed
Update `requirements.txt` (#838)
WeilerP Mar 14, 2022
9bfd9fb
Fix `optimization.py::get_weight` (#839)
WeilerP Mar 14, 2022
0ee2019
Fix inference with `fit_scaling=False` (#848)
WeilerP Mar 25, 2022
66a6954
Update `pre-commit` setup (#855)
WeilerP Apr 8, 2022
85295fc
Add argument `file_path` (#853)
WeilerP Apr 8, 2022
ff39b4f
Update `CONTRIBUTING.rst` [ci skip] (#911)
Oisin-M Jul 28, 2022
32ce21b
Fix saving stream embedding figure (#900)
DriesSchaumont Aug 2, 2022
8d56d1e
Fix `clean_obs_names` (#921)
Oisin-M Oct 2, 2022
044d630
Fix Pandas display precision (#907)
WeilerP Oct 2, 2022
2bf57d1
Fix documentation issues [ci skip] (#929)
WeilerP Oct 2, 2022
cc1e200
Add key contributors section [ci skip] (#930)
WeilerP Oct 2, 2022
c424f20
Fix deprecation of keyword argument `copy` (#932)
WeilerP Oct 3, 2022
d473214
Update `CONTRIBUTING.rst` [ci skip] (#938)
WeilerP Oct 10, 2022
84a43d4
Fix linear regression unit tests (#940)
WeilerP Oct 11, 2022
447592e
Update `test_neighbors.py` (#941)
WeilerP Oct 13, 2022
bc73300
Update release notes [ci skip] (#945)
WeilerP Oct 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .editorconfig
@@ -0,0 +1,15 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 88

[*.py]
indent_size = 4
indent_style = space
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
@@ -0,0 +1,19 @@
## Changes
<!-- Please remove section if this PR does change an existing feature -->

* ...

## Bug fixes
<!-- Please give section if this PR does not fix any bugs -->

* ...

## New
<!-- Please give section if this PR does not implement a new feature -->

* ...

## Related issues
<!-- Please list related issues. If none exist, open one and reference it here. -->

Closes #
30 changes: 24 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -26,10 +26,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.7
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -42,19 +42,37 @@ jobs:
# Run unit tests
test:
needs: linting
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [3.7]
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e '.[dev]'
- name: Unit tests
timeout-minutes: 60
run: python -m pytest --durations=25 --ignore=tests/datasets/test_datasets.py --hypothesis-profile=ci --cov=scvelo -vv

test-dataset-downloads:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install -e .
pip install hypothesis pytest pytest-cov
- name: Unit tests
run: python -m pytest --cov=scvelo
- name: Test dataset downloads
timeout-minutes: 60
run: python -m pytest tests/datasets/test_datasets.py -vv
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -42,3 +42,5 @@ docs/source/scvelo*

# Files generated by unit tests
.hypothesis/
.coverage*
htmlcov/
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/ambv/black
rev: 20.8b1
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/PyCQA/flake8
rev: 3.8.4
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.7.0
rev: 5.10.1
hooks:
- id: isort
name: isort (python)
Expand Down
28 changes: 23 additions & 5 deletions CONTRIBUTING.rst
Expand Up @@ -21,7 +21,15 @@ You can now clone your fork of scVelo and install the development mode

git clone https://github.com/YOUR-USER-NAME/scvelo.git
cd scvelo
git checkout --track origin/develop


Unix Systems
^^^^^^^^^^^^

The installation can be completed with

.. code:: bash

pip install -e '.[dev]'

The last line can, alternatively, be replaced by
Expand All @@ -31,16 +39,26 @@ The last line can, alternatively, be replaced by
pip install -r requirements-dev.txt


Finally, to make sure your code follows our code style guideline, install pre-commit:
Windows
^^^^^^^

If running Windows, `hsnwlib` needs to be installed via `conda` and the installation with pip slightly adjusted:

.. code:: bash

pre-commit install
conda install -c conda-forge hnswlib
pip install -e .[dev]


Coding style
^^^^^^^^^^^^

Finally, to make sure your code follows our code style guideline, install pre-commit:

.. code:: bash

pre-commit install

Our code follows `black` and `flake8` coding style. Code formatting (`black`, `isort`) is automated through pre-commit hooks. In addition, we require that

- functions are fully type-annotated.
Expand Down Expand Up @@ -69,9 +87,9 @@ The docstrings of scVelo largely follow the `numpy`-style. New docstrings should
Submitting pull requests
^^^^^^^^^^^^^^^^^^^^^^^^

New features and bug fixes are added to the code base through a pull request (PR). To implement a feature or bug fix, create a branch from `develop`. For hotfixes use `master` as base. The existence of bugs suggests insufficient test coverage. As such, bug fixes should, ideally, include a unit test or extend an existing one. Please ensure that
New features and bug fixes are added to the code base through a pull request (PR). To implement a feature or bug fix, create a branch from `master`. The existence of bugs suggests insufficient test coverage. As such, bug fixes should, ideally, include a unit test or extend an existing one. Please ensure that

- branch names have the prefix `feat/`, `bug/` or `hotfix/`.
- branch names have the prefix `feat/` or `fix/`.
- your code follows the project conventions.
- newly added functions are unit tested.
- all tests pass locally.
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Expand Up @@ -6,8 +6,9 @@ typing_extensions
importlib_metadata
sphinx_rtd_theme>=0.3
sphinx_autodoc_typehints<=1.6
Jinja2<3.1

# converting notebooks to html
ipykernel
sphinx>=1.7,<4.0
nbsphinx>=0.7,<0.8.7
nbsphinx>=0.7,<0.8.7
7 changes: 7 additions & 0 deletions docs/source/_key_contributors.rst
@@ -0,0 +1,7 @@
.. sidebar:: Key Contributors

* `Philipp Weiler`_: lead developer since 2021, maintainer
* `Volker Bergen`_: lead developer 2018-2021, initial conception

.. _Philipp Weiler: https://twitter.com/PhilippWeiler7
.. _Volker Bergen: https://twitter.com/volkerbergen
2 changes: 1 addition & 1 deletion docs/source/conf.py
Expand Up @@ -148,7 +148,7 @@


def setup(app):
app.add_stylesheet("custom.css")
app.add_css_file("custom.css")


# -- Options for other output ------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting_started.rst
Expand Up @@ -6,7 +6,7 @@ Once you are set, the following tutorials go straight into analysis of RNA veloc
latent time, driver identification and many more.

First of all, the input data for scVelo are two count matrices of pre-mature (unspliced) and mature (spliced) abundances,
which can be obtained from standard sequencing protocols, using the `velocyto`_ or `loompy/kallisto`_
which can be obtained from standard sequencing protocols, using the `velocyto`_ or `kallisto`_
counting pipeline.

scVelo workflow at a glance
Expand Down Expand Up @@ -89,4 +89,4 @@ For every tool module there is a plotting counterpart, which allows you to exami


.. _`velocyto`: http://velocyto.org/velocyto.py/tutorial/cli.html
.. _`loompy/kallisto`: https://linnarssonlab.org/loompy/kallisto/index.html
.. _`kallisto`: https://www.kallistobus.tools/tutorials/kb_velocity/python/kb_velocity/#generate-rna-velocity-count-matrices
8 changes: 5 additions & 3 deletions docs/source/index.rst
Expand Up @@ -7,6 +7,8 @@ scVelo - RNA velocity generalized through dynamical modeling
:width: 300px
:align: left

.. include:: _key_contributors.rst

**scVelo** is a scalable toolkit for RNA velocity analysis in single cells, based on
`Bergen et al. (Nature Biotech, 2020) <https://doi.org/10.1038/s41587-020-0591-3>`_.

Expand All @@ -16,7 +18,7 @@ scVelo generalizes the concept of RNA velocity
by relaxing previously made assumptions with a stochastic and a dynamical model that solves the full
transcriptional dynamics. It thereby adapts RNA velocity to widely varying specifications such as non-stationary populations.

scVelo is compatible with scanpy_ and hosts efficient implementations of all RNA velocity models.
scVelo is compatible with Scanpy_ and hosts efficient implementations of all RNA velocity models.

scVelo's key applications
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -104,7 +106,7 @@ For further information visit `scvelo.org <https://scvelo.org>`_.
.. |travis| image:: https://travis-ci.org/theislab/scvelo.svg?branch=master
:target: https://travis-ci.org/theislab/scvelo

.. _scanpy: https://scanpy.readthedocs.io
.. _Scanpy: https://scanpy.readthedocs.io

.. _calendly: https://calendly.com/scvelo

Expand All @@ -123,4 +125,4 @@ For further information visit `scvelo.org <https://scvelo.org>`_.
.. |dim| raw:: html

<span class="__dimensions_badge_embed__" data-id="pub.1129830274" data-style="small_rectangle"></span>
<script async src="https://badge.dimensions.ai/badge.js" charset="utf-8"></script>
<script async src="https://badge.dimensions.ai/badge.js" charset="utf-8"></script>
26 changes: 23 additions & 3 deletions docs/source/release_notes.rst
Expand Up @@ -4,13 +4,33 @@
Release Notes
=============

Version 0.2.5 :small:`Oct 14, 2022`
-----------------------------------

Changes:

- Catch non-positive parameter values and raise a `ValueError` if necessary (`PR 614 <https://github.com/theislab/scvelo/pull/614>`_).
- `get_mean_var` uses the same size parameter for mean and variance (`PR 698 <https://github.com/theislab/scvelo/pull/698>`_).

Bugfixes:

- `filter_genes` now works with `adata.layers['unspliced']` being sparse and `adata.layers['spliced']` dense (`PR 537 <https://github.com/theislab/scvelo/pull/537>`_).
- `show_proportions` actually considers the layer `"ambiguous"` if present (`PR 587 <https://github.com/theislab/scvelo/pull/587>`_).
- Fix calculation of Pearson's correlation in `csr_vcorrcoef` (`PR 679 <https://github.com/theislab/scvelo/pull/679>`_).
- Fix `get_mean_var` to work with sparse input and `ignore_zeros=True` (`PR 698 <https://github.com/theislab/scvelo/pull/698>`_).
- Fix bug in neighbor calculation (`PR 797 <https://github.com/theislab/scvelo/pull/797>`_).
- Fix `optimization.py::get_weight` to work with numeric, non-integer values (`PR 839 <https://github.com/theislab/scvelo/pull/839>`_).
- Fix inference with `fit_scaling=False` (`PR 848 <https://github.com/theislab/scvelo/pull/848>`_).
- Fix saving of velocity embedding stream (`PR 900 <https://github.com/theislab/scvelo/pull/900>`_).
- Fix Pandas' display precison when passed to `get_df` (`PR 907 <https://github.com/theislab/scvelo/pull/907>`_).

Version 0.2.4 :small:`Aug 26, 2021`
-----------------------------------

Perspectives:

- Landing page and two notebooks accompanying the perspectives manuscript at MSB.
- New datasets: Gastrulation, bone marrow, and PBMCs.
- Landing page and two notebooks accompanying the perspectives manuscript at MSB.
- New datasets: Gastrulation, bone marrow, and PBMCs.

New capabilities:

Expand All @@ -25,7 +45,7 @@ New capabilities:
Bugfixes:

- Pinned `sphinx<4.0` and `nbsphinx<0.8.7`.
- Fix IPython import at CLI.
- Fix IPython import at CLI.


Version 0.2.3 :small:`Feb 13, 2021`
Expand Down
4 changes: 1 addition & 3 deletions pytest.ini
@@ -1,6 +1,4 @@
[pytest]
python_files = test_*.py
testpaths =
tests
scvelo
testpaths = tests/
xfail_strict = true
6 changes: 4 additions & 2 deletions requirements-dev.txt
Expand Up @@ -2,13 +2,15 @@

-e .

black==20.8b1
black==22.3.0
hnswlib
hypothesis
flake8==3.8.4
isort==5.7.0
isort==5.10.1
louvain
magic-impute
pre-commit>=2.9.0
pybind11
pytest>=6.2.2
pytest-cov
python-igraph
4 changes: 2 additions & 2 deletions requirements.txt
Expand Up @@ -14,6 +14,6 @@ umap-learn>=0.3.10 # removed numba warnings (v0.3.10)
numba>=0.41.0
numpy>=1.17 # extension/speedup in .nan_to_num, .exp (v1.17)
scipy>=1.4.1 # introduced PCA sparsity support (v1.4)
pandas>=0.23 # merging/sorting extensions (v0.23)
pandas>=0.23, !=1.4.0 # merging/sorting extensions (v0.23)
scikit-learn>=0.21.2 # bugfix in .utils.sparsefuncs (v0.21.2)
matplotlib>=3.3.0 # normalize in pie (v3.3.0)
matplotlib>=3.3.0 # normalize in pie (v3.3.0)
11 changes: 10 additions & 1 deletion scvelo/__init__.py
Expand Up @@ -2,7 +2,12 @@
from anndata import AnnData
from scanpy import read, read_loom

from scvelo import datasets, logging, pl, pp, settings, tl, utils
from scvelo import datasets, logging
from scvelo import plotting as pl
from scvelo import preprocessing as pp
from scvelo import settings
from scvelo import tools as tl
from scvelo import utils
from scvelo.core import get_df
from scvelo.plotting.gridspec import GridSpec
from scvelo.preprocessing.neighbors import Neighbors
Expand All @@ -13,6 +18,10 @@
from scvelo.tools.velocity import Velocity
from scvelo.tools.velocity_graph import VelocityGraph

import sys # isort:skip

sys.modules.update({f"{__name__}.{m}": globals()[m] for m in ["tl", "pp", "pl"]})

try:
from setuptools_scm import get_version

Expand Down
5 changes: 4 additions & 1 deletion scvelo/core/__init__.py
Expand Up @@ -12,16 +12,18 @@
set_modality,
show_proportions,
)
from ._arithmetic import clipped_log, invert, prod_sum, sum
from ._arithmetic import clipped_log, invert, multiply, prod_sum, sum
from ._linear_models import LinearRegression
from ._metrics import l2_norm
from ._models import SplicingDynamics
from ._parallelize import get_n_jobs, parallelize
from ._utils import deprecated_arg_names

__all__ = [
"clean_obs_names",
"cleanup",
"clipped_log",
"deprecated_arg_names",
"get_df",
"get_initial_size",
"get_modality",
Expand All @@ -33,6 +35,7 @@
"make_dense",
"make_sparse",
"merge",
"multiply",
"parallelize",
"prod_sum",
"set_initial_size",
Expand Down