Skip to content

Commit

Permalink
Refactor with more extras_require
Browse files Browse the repository at this point in the history
  • Loading branch information
keller-mark committed Sep 3, 2023
1 parent 6cd3505 commit ab0a172
Show file tree
Hide file tree
Showing 21 changed files with 252 additions and 478 deletions.
9 changes: 5 additions & 4 deletions .coveragerc_omit
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ omit =
vitessce/widget.py
vitessce/wrappers.py
vitessce/repr.py
vitessce/data_utils/anndata.py
vitessce/data_utils/ome.py
vitessce/data_utils/entities.py
vitessce/data_utils/multivec.py
vitessce/data_utils/anndata/anndata.py
vitessce/data_utils/multivec/multivec.py
vitessce/data_utils/ome_tiff/ome_tiff.py
vitessce/data_utils/ome_zarr/ome_zarr.py
vitessce/data_utils/ucsc_cellbrowser/ucsc_cellbrowser.py
10 changes: 8 additions & 2 deletions docs/api_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ vitessce.export
vitessce.data_utils
*****************

.. automodule:: vitessce.data_utils.ome
.. automodule:: vitessce.data_utils.anndata.anndata
:members:
.. automodule:: vitessce.data_utils.anndata
.. automodule:: vitessce.data_utils.multivec.multivec
:members:
.. automodule:: vitessce.data_utils.ome_tiff.ome_tiff
:members:
.. automodule:: vitessce.data_utils.ome_zarr.ome_zarr
:members:
.. automodule:: vitessce.data_utils.ucsc_cellbrowser.ucsc_cellbrowser
:members:
34 changes: 33 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,40 @@ testing = []
linting = []
notebook = []

# data_utils extras_require
# These dependencies are required
# to use the corresponding data_utils sub-packages.
anndata = [
'zarr>=2.5.0',
'numcodecs>=0.5.7',
'anndata>=0.7.8,<0.9',
'scanpy>=1.9.3'
]
ome_zarr = [
'zarr>=2.5.0',
'numcodecs>=0.5.7',
'ome-zarr==0.2.1'
]
ome_tiff = [
'generate-tiff-offsets>=0.1.7',
'tifffile>=2020.10.1'
]
multivec = [
'zarr>=2.5.0',
'numcodecs>=0.5.7',
'negspy>=0.2.24'
]

[project.urls]
repository = "https://github.com/vitessce/vitessce-python"

[tool.setuptools]
packages = ["vitessce", "vitessce.data_utils"]
packages = [
"vitessce",
"vitessce.data_utils",
"vitessce.data_utils.anndata",
"vitessce.data_utils.multivec",
"vitessce.data_utils.ome_tiff",
"vitessce.data_utils.ome_zarr",
"vitessce.data_utils.ucsc_cellbrowser"
]
4 changes: 3 additions & 1 deletion tests/test_anndata_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
from scipy.io import mmread
import zarr

from vitessce.data_utils import (
from vitessce.data_utils.anndata import (
optimize_arr,
optimize_adata,
sort_var_axis,
to_uint8,
)
from vitessce.data_utils.multivec import (
adata_to_multivec_zarr,
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_config_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import patch, Mock
from copy import deepcopy

from vitessce import (
from vitessce.data_utils.ucsc_cellbrowser import (
CellBrowserToAnndataZarrConverter,
convert_cell_browser_project_to_anndata,
)
Expand Down
111 changes: 0 additions & 111 deletions tests/test_entities.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/test_ome_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import zarr
import numpy as np

from vitessce.data_utils import (
from vitessce.data_utils.ome_zarr import (
rgb_img_to_ome_zarr,
)

Expand Down
5 changes: 0 additions & 5 deletions vitessce/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
BASE_URL_PLACEHOLDER,
)

from .config_converter import (
CellBrowserToAnndataZarrConverter, # only exported for testing.
convert_cell_browser_project_to_anndata,
)

from .wrappers import AbstractWrapper

# We allow installation without all of the dependencies that the widget requires.
Expand Down
18 changes: 0 additions & 18 deletions vitessce/data_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,18 +0,0 @@
from .anndata import (
optimize_adata,
optimize_arr,
to_dense,
to_uint8,
sort_var_axis,
to_diamond,
VAR_CHUNK_SIZE,
)
from .ome import (
rgb_img_to_ome_zarr,
multiplex_img_to_ome_zarr,
rgb_img_to_ome_tiff,
multiplex_img_to_ome_tiff,
)
from .multivec import (
adata_to_multivec_zarr,
)
10 changes: 10 additions & 0 deletions vitessce/data_utils/anndata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .anndata import (
optimize_adata,
optimize_arr,
to_dense,
to_uint8,
sort_var_axis,
to_diamond,
VAR_CHUNK_SIZE,
cast_arr,
)
File renamed without changes.
Loading

0 comments on commit ab0a172

Please sign in to comment.