Skip to content

Commit 073d01a

Browse files
committed
add pre-commit
1 parent f4d0bbc commit 073d01a

File tree

16 files changed

+740
-745
lines changed

16 files changed

+740
-745
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,3 @@ repos:
2727
# Check that there are no merge conflicts (could be generated by template sync)
2828
- id: check-merge-conflict
2929
args: [--assume-in-merge]
30-
- repo: local
31-
hooks:
32-
- id: forbid-to-commit
33-
name: Don't commit rej files
34-
entry: |
35-
Cannot commit .rej files. These indicate merge conflicts that arise during automated template updates.
36-
Fix the merge conflicts manually and remove the .rej files.
37-
language: fail
38-
files: '.*\.rej$'

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ dev = [
5151
docs = [
5252
'sphinx==4.2.0',
5353
'sphinx-rtd-theme==1.0.0',
54-
54+
5555
# Pin sub-dependencies of sphinx
5656
# Reference: https://github.com/sphinx-doc/sphinx/issues/11130
5757
'sphinxcontrib-applehelp==1.0.4',
@@ -60,7 +60,7 @@ docs = [
6060
'sphinxcontrib-jsmath==1.0.1',
6161
'sphinxcontrib-qthelp==1.0.3',
6262
'sphinxcontrib-serializinghtml==1.1.5',
63-
63+
6464
'nbsphinx==0.8.8',
6565
'nbclean==0.3.2',
6666
# Pin sqlalchemy to before 1.4 to fix issue importing nbclean.NotebookCleaner
@@ -99,6 +99,8 @@ packages = ["vitessce", "vitessce.data_utils"]
9999
[tool.ruff]
100100
line-length = 120
101101
src = ["src"]
102+
exclude = ["docs", "tests", "demos", "binder", "README.md"]
103+
force-exclude = true
102104
extend-include = ["*.ipynb"]
103105

104106
[tool.ruff.format]
@@ -153,4 +155,4 @@ convention = "numpy"
153155
"docs/*" = ["I"]
154156
"vitessce/constants.py" = ["D"]
155157
"tests/*" = ["D"]
156-
"*/__init__.py" = ["F401"]
158+
"*/__init__.py" = ["F401"]

vitessce/__init__.py

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,65 +2,62 @@
22
from warnings import warn
33

44
from .config import (
5-
VitessceConfig,
5+
CoordinationLevel,
66
VitessceChainableConfig,
7+
VitessceConfig,
78
VitessceConfigDatasetFile,
89
hconcat,
910
vconcat,
10-
CoordinationLevel,
1111
)
12-
13-
from .utils import (
14-
get_initial_coordination_scope_prefix,
15-
get_initial_coordination_scope_name,
12+
from .config_converter import (
13+
CellBrowserToAnndataZarrConverter, # only exported for testing.
14+
convert_cell_browser_project_to_anndata,
1615
)
17-
18-
from .repr import make_repr
19-
2016
from .constants import (
17+
BASE_URL_PLACEHOLDER,
2118
CoordinationType,
22-
ViewType,
2319
DataType,
2420
FileType,
21+
ViewType,
22+
)
23+
from .constants import (
2524
# For backwards compatibility, also export ViewType as Component
2625
ViewType as Component,
27-
BASE_URL_PLACEHOLDER,
2826
)
29-
30-
from .config_converter import (
31-
CellBrowserToAnndataZarrConverter, # only exported for testing.
32-
convert_cell_browser_project_to_anndata,
27+
from .repr import make_repr
28+
from .utils import (
29+
get_initial_coordination_scope_name,
30+
get_initial_coordination_scope_prefix,
3331
)
34-
3532
from .wrappers import AbstractWrapper
3633

3734
# We allow installation without all of the dependencies that the widget requires.
3835
# The imports below will fail in that case, and corresponding globals will be undefined.
3936
try:
4037
from .widget import VitessceWidget, data_server
4138
except ModuleNotFoundError as e: # pragma: no cover
42-
warn(f'Extra installs are necessary to use widgets: {e}')
39+
warn(f"Extra installs are necessary to use widgets: {e}")
4340

4441
try:
4542
from .wrappers import (
46-
OmeTiffWrapper,
47-
OmeZarrWrapper,
48-
MultiImageWrapper,
49-
CsvWrapper,
5043
AnnDataWrapper,
51-
MultivecZarrWrapper,
44+
CsvWrapper,
5245
ImageOmeTiffWrapper,
53-
ObsSegmentationsOmeTiffWrapper,
5446
ImageOmeZarrWrapper,
47+
MultiImageWrapper,
48+
MultivecZarrWrapper,
49+
ObsSegmentationsOmeTiffWrapper,
5550
ObsSegmentationsOmeZarrWrapper,
51+
OmeTiffWrapper,
52+
OmeZarrWrapper,
5653
)
5754
except ModuleNotFoundError as e: # pragma: no cover
58-
warn(f'Extra installs are necessary to use wrappers: {e}')
55+
warn(f"Extra installs are necessary to use wrappers: {e}")
5956

6057
try:
6158
from .export import (
62-
export_to_s3,
6359
export_to_files,
60+
export_to_s3,
6461
)
6562
except ModuleNotFoundError as e: # pragma: no cover
66-
warn(f'Extra installs are necessary to use exports: {e}')
63+
warn(f"Extra installs are necessary to use exports: {e}")

0 commit comments

Comments
 (0)