-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Updates pre-commit hooks to align with scverse packages. * Updates and fixes docstrings to pass pre-commit hooks. If the fix is not permanent, a corresponding TODO comment is added. * Updates spacing if needed. * Update exception handling to not rely on bare excepts. * Update arguments to non-mutable objects. * Avoid redundant list comprehension. * Update for loops to remove redundant operations and variables.
- Loading branch information
Showing
68 changed files
with
1,329 additions
and
589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,63 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
filename = *.py | ||
exclude = | ||
.git, | ||
__pycache__, | ||
docs/* | ||
# F403: unable to detect undefined names | ||
# F405: undefined, or defined from star imports | ||
# W503: Linebreak before binary operator | ||
ignore = F403, F405, W503 | ||
max-line-length = 119 | ||
ignore = | ||
# Unnecessary dict call - rewrite as a literal. | ||
C408 | ||
# line break before a binary operator -> black does not adhere to PEP8 | ||
W503 | ||
# line break occured after a binary operator -> black does not adhere to PEP8 | ||
W504 | ||
# line too long -> we accept long comment lines; black gets rid of long code lines | ||
E501 | ||
# whitespace before : -> black does not adhere to PEP8 | ||
E203 | ||
# missing whitespace after ,', ';', or ':' -> black does not adhere to PEP8 | ||
E231 | ||
# continuation line over-indented for hanging indent -> black does not adhere to PEP8 | ||
E126 | ||
# too many leading '#' for block comment -> this is fine for indicating sections | ||
E262 | ||
# 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 | ||
D104 | ||
# Missing docstring in public module | ||
D100 | ||
# Missing docstring in __init__ | ||
D107 | ||
# Missing docstring in magic method | ||
D105 | ||
# format string does contain unindexed parameters | ||
P101 | ||
# first line should end with a period [Bug: doesn't work with single-line docstrings] | ||
D400 | ||
# First line should be in imperative mood; try rephrasing | ||
D401 | ||
exclude = .git,__pycache__,build,docs/_build,dist,scvi/__init__.py | ||
per-file-ignores = | ||
tests/*: D | ||
*/__init__.py: F401 | ||
extend-immutable-calls = | ||
# Add functions returning immutable values here to avoid B008 | ||
pathlib.Path | ||
Path | ||
rst-roles = | ||
class, | ||
func, | ||
ref, | ||
meth, | ||
doc, | ||
py:class, | ||
method, | ||
attr, | ||
cite:p, | ||
cite:t, | ||
rst-directives = | ||
envvar, | ||
exception, | ||
rst-substitutions = | ||
version, | ||
extend-ignore = | ||
RST307,RST210,RST201,RST203,RST301 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
--- | ||
name: Enhancement request | ||
about: Anything you’d like to see in scVelo? | ||
title: '' | ||
title: "" | ||
labels: enhancement | ||
assignees: '' | ||
assignees: "" | ||
--- | ||
|
||
<!-- What kind of feature would you like to request? --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
## 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 # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [master, develop, 'release/**'] | ||
pull_request: | ||
branches: [master, develop, 'release/**'] | ||
push: | ||
branches: [master, develop, "release/**"] | ||
pull_request: | ||
branches: [master, develop, "release/**"] | ||
|
||
jobs: | ||
# Skip CI if commit message contains `[ci skip]` in the subject | ||
init: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
skip: ${{ steps.ci-skip-step.outputs.ci-skip }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- id: ci-skip-step | ||
uses: mstachniuk/ci-skip@master | ||
# Skip CI if commit message contains `[ci skip]` in the subject | ||
init: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
skip: ${{ steps.ci-skip-step.outputs.ci-skip }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- id: ci-skip-step | ||
uses: mstachniuk/ci-skip@master | ||
|
||
# Check if pre-commit hooks pass and if README.rst can be converted to HTML | ||
linting: | ||
needs: init | ||
if: ${{ needs.init.outputs.skip == 'false' }} | ||
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: | | ||
python -m pip install --upgrade pip | ||
pip install pre-commit docutils | ||
- name: Check pre-commit compatibility | ||
run: pre-commit run --all-files --show-diff-on-failure | ||
- name: Run rst2html.py | ||
run: rst2html.py --halt=2 README.rst >/dev/null | ||
# Check if pre-commit hooks pass and if README.rst can be converted to HTML | ||
linting: | ||
needs: init | ||
if: ${{ needs.init.outputs.skip == 'false' }} | ||
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: | | ||
python -m pip install --upgrade pip | ||
pip install pre-commit docutils | ||
- name: Check pre-commit compatibility | ||
run: pre-commit run --all-files --show-diff-on-failure | ||
- name: Run rst2html.py | ||
run: rst2html.py --halt=2 README.rst >/dev/null | ||
|
||
# Run unit tests | ||
test: | ||
needs: linting | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [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 | ||
# Run unit tests | ||
test: | ||
needs: linting | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [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: Test dataset downloads | ||
timeout-minutes: 60 | ||
run: python -m pytest tests/datasets/test_datasets.py -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: Test dataset downloads | ||
timeout-minutes: 60 | ||
run: python -m pytest tests/datasets/test_datasets.py -vv |
Oops, something went wrong.