Skip to content

Commit c76f70c

Browse files
committed
rm iter/common classes/types from public APIs
1 parent a6e2409 commit c76f70c

File tree

14 files changed

+43
-50
lines changed

14 files changed

+43
-50
lines changed

docs/conf.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ def setup(app):
6363
.. |shuffle_chunk_size| replace:: :attr:`shuffle_chunk_size <tiledbsoma_ml.ExperimentDataset.shuffle_chunk_size>`
6464
.. |return_sparse_X| replace:: :attr:`return_sparse_X <tiledbsoma_ml.ExperimentDataset.return_sparse_X>`
6565
.. |experiment_dataloader| replace:: :obj:`~tiledbsoma_ml.experiment_dataloader`
66-
.. |MiniBatch| replace:: :class:`~tiledbsoma_ml.common.MiniBatch`
67-
.. |mini batches| replace:: :class:`"mini batches" <tiledbsoma_ml.common.MiniBatch>`
68-
.. |NDArrayJoinId| replace:: :class:`~tiledbsoma_ml.common.NDArrayJoinId`
69-
.. |Partition| replace:: :class:`~tiledbsoma_ml.query_ids.Partition`
70-
.. |QueryIDs| replace:: :class:`~tiledbsoma_ml.query_ids.QueryIDs`
71-
.. |obs_joinids| replace:: :obj:`~tiledbsoma_ml.query_ids.QueryIDs.obs_joinids`
72-
.. |QueryIDs.shuffle_chunks| replace:: :meth:`QueryIDs.shuffle_chunks <tiledbsoma_ml.query_ids.QueryIDs.shuffle_chunks>`
73-
.. |QueryIDs.random_split| replace:: :meth:`QueryIDs.random_split <tiledbsoma_ml.query_ids.QueryIDs.random_split>`
74-
.. |Chunks| replace:: :class:`~tiledbsoma_ml.query_ids.Chunks`
75-
.. |SamplingMethod| replace:: :class:`~tiledbsoma_ml.query_ids.SamplingMethod`
76-
.. |IOBatch| replace:: :class:`~tiledbsoma_ml.io_batch_iterable.IOBatch`
77-
.. |IOBatchIterable| replace:: :class:`~tiledbsoma_ml.io_batch_iterable.IOBatchIterable`
66+
.. |MiniBatch| replace:: :class:`~tiledbsoma_ml._common.MiniBatch`
67+
.. |mini batches| replace:: :class:`"mini batches" <tiledbsoma_ml._common.MiniBatch>`
68+
.. |NDArrayJoinId| replace:: :class:`~tiledbsoma_ml._common.NDArrayJoinId`
69+
.. |Partition| replace:: :class:`~tiledbsoma_ml._query_ids.Partition`
70+
.. |QueryIDs| replace:: :class:`~tiledbsoma_ml._query_ids.QueryIDs`
71+
.. |obs_joinids| replace:: :obj:`~tiledbsoma_ml._query_ids.QueryIDs.obs_joinids`
72+
.. |QueryIDs.shuffle_chunks| replace:: :meth:`QueryIDs.shuffle_chunks <tiledbsoma_ml._query_ids.QueryIDs.shuffle_chunks>`
73+
.. |QueryIDs.random_split| replace:: :meth:`QueryIDs.random_split <tiledbsoma_ml._query_ids.QueryIDs.random_split>`
74+
.. |Chunks| replace:: :class:`~tiledbsoma_ml._query_ids.Chunks`
75+
.. |SamplingMethod| replace:: :class:`~tiledbsoma_ml._query_ids.SamplingMethod`
76+
.. |IOBatch| replace:: :class:`~tiledbsoma_ml._io_batch_iterable.IOBatch`
77+
.. |IOBatchIterable| replace:: :class:`~tiledbsoma_ml._io_batch_iterable.IOBatchIterable`
7878
.. |CSR_IO_Buffer| replace:: :class:`~tiledbsoma_ml._csr.CSR_IO_Buffer`
7979
.. |get_distributed_rank_and_world_size| replace:: :obj:`~tiledbsoma_ml._distributed.get_distributed_rank_and_world_size`
8080
.. |get_worker_id_and_num| replace:: :obj:`~tiledbsoma_ml._distributed.get_worker_id_and_num`

docs/index.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ Module Contents
3333
Batching and Data Management
3434
----------------------------
3535

36-
``common``
37-
^^^^^^^^^^
36+
``_common``
37+
^^^^^^^^^^^
3838

39-
.. automodule:: tiledbsoma_ml.common
39+
.. automodule:: tiledbsoma_ml._common
4040
:members:
4141
:undoc-members:
4242

43-
``query_ids``
44-
^^^^^^^^^^^^^
43+
``_query_ids``
44+
^^^^^^^^^^^^^^
4545

46-
.. automodule:: tiledbsoma_ml.query_ids
46+
.. automodule:: tiledbsoma_ml._query_ids
4747

4848
QueryIDs
4949
~~~~~~~~
@@ -67,17 +67,17 @@ SamplingMethod
6767
~~~~~~~~~~~~~~
6868
.. autoclass:: SamplingMethod
6969

70-
``io_batch_iterable``
71-
^^^^^^^^^^^^^^^^^^^^^
70+
``_io_batch_iterable``
71+
^^^^^^^^^^^^^^^^^^^^^^
7272

73-
.. automodule:: tiledbsoma_ml.io_batch_iterable
73+
.. automodule:: tiledbsoma_ml._io_batch_iterable
7474
:members:
7575
:undoc-members:
7676

77-
``mini_batch_iterable``
78-
^^^^^^^^^^^^^^^^^^^^^^^
77+
``_mini_batch_iterable``
78+
^^^^^^^^^^^^^^^^^^^^^^^^
7979

80-
.. automodule:: tiledbsoma_ml.mini_batch_iterable
80+
.. automodule:: tiledbsoma_ml._mini_batch_iterable
8181
:members:
8282
:undoc-members:
8383

src/tiledbsoma_ml/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
from importlib.metadata import PackageNotFoundError, version
88

9-
from .common import MiniBatch, NDArrayJoinId, NDArrayNumber, XBatch
9+
from ._query_ids import SamplingMethod
1010
from .dataloader import experiment_dataloader
1111
from .dataset import ExperimentDataset
12-
from .query_ids import SamplingMethod
1312

1413
try:
1514
__version__ = version("tiledbsoma-ml")
@@ -21,11 +20,5 @@
2120
__all__ = [
2221
"ExperimentDataset",
2322
"experiment_dataloader",
24-
# Type aliases, from `.common`
25-
"MiniBatch",
26-
"NDArrayJoinId",
27-
"NDArrayNumber",
28-
"XBatch",
29-
# `.query_ids`
3023
"SamplingMethod",
3124
]

src/tiledbsoma_ml/_csr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from scipy import sparse
1717
from typing_extensions import Self
1818

19-
from tiledbsoma_ml.common import NDArrayNumber
19+
from tiledbsoma_ml._common import NDArrayNumber
2020

2121
_CSRIdxArray = npt.NDArray[np.unsignedinteger[Any]]
2222

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
import pyarrow as pa
1515
from tiledbsoma import DataFrame, IntIndexer, SparseNDArray
1616

17+
from tiledbsoma_ml._common import NDArrayJoinId
1718
from tiledbsoma_ml._csr import CSR_IO_Buffer
1819
from tiledbsoma_ml._eager_iter import EagerIterator
20+
from tiledbsoma_ml._query_ids import Chunks
1921
from tiledbsoma_ml._utils import batched
20-
from tiledbsoma_ml.common import NDArrayJoinId
21-
from tiledbsoma_ml.query_ids import Chunks
2222

23-
logger = logging.getLogger("tiledbsoma_ml.io_batch_iterable")
23+
logger = logging.getLogger("tiledbsoma_ml._io_batch_iterable")
2424
IOBatch = Tuple[CSR_IO_Buffer, pd.DataFrame]
2525
"""Tuple type emitted by |IOBatchIterable|, containing ``X`` rows (as a |CSR_IO_Buffer|) and ``obs`` rows
2626
(|pd.DataFrame|)."""
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
import pandas as pd
1313
from scipy import sparse
1414

15+
from tiledbsoma_ml._common import MiniBatch
1516
from tiledbsoma_ml._eager_iter import EagerIterator
16-
from tiledbsoma_ml.common import MiniBatch
17-
from tiledbsoma_ml.io_batch_iterable import IOBatchIterable
17+
from tiledbsoma_ml._io_batch_iterable import IOBatchIterable
1818

19-
logger = logging.getLogger("tiledbsoma_ml.mini_batch_iterable")
19+
logger = logging.getLogger("tiledbsoma_ml._mini_batch_iterable")
2020

2121

2222
@attrs.define(frozen=True)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
from attrs import define, evolve
1919
from tiledbsoma import ExperimentAxisQuery
2020

21+
from tiledbsoma_ml._common import NDArrayJoinId
2122
from tiledbsoma_ml._utils import batched, splits
22-
from tiledbsoma_ml.common import NDArrayJoinId
2323

24-
logger = logging.getLogger("tiledbsoma_ml.query_ids")
24+
logger = logging.getLogger("tiledbsoma_ml._query_ids")
2525

2626

2727
Chunks = List[NDArrayJoinId]

src/tiledbsoma_ml/dataset.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
from tiledbsoma import ExperimentAxisQuery
1717
from torch.utils.data import IterableDataset
1818

19+
from tiledbsoma_ml._common import MiniBatch
1920
from tiledbsoma_ml._distributed import (
2021
get_distributed_rank_and_world_size,
2122
get_worker_id_and_num,
2223
)
23-
from tiledbsoma_ml.common import MiniBatch
24-
from tiledbsoma_ml.io_batch_iterable import IOBatchIterable
25-
from tiledbsoma_ml.mini_batch_iterable import MiniBatchIterable
26-
from tiledbsoma_ml.query_ids import Partition, QueryIDs, SamplingMethod
24+
from tiledbsoma_ml._io_batch_iterable import IOBatchIterable
25+
from tiledbsoma_ml._mini_batch_iterable import MiniBatchIterable
26+
from tiledbsoma_ml._query_ids import Partition, QueryIDs, SamplingMethod
2727
from tiledbsoma_ml.x_locator import XLocator
2828

2929
logger = logging.getLogger("tiledbsoma_ml.dataset")

tests/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from tiledbsoma._collection import CollectionBase
2020
from torch.utils.data._utils.worker import WorkerInfo
2121

22-
from tiledbsoma_ml.common import MiniBatch, NDArrayJoinId
22+
from tiledbsoma_ml._common import MiniBatch, NDArrayJoinId
2323

2424
XValueGen = Callable[[range, range], coo_matrix]
2525
ExpectedBatch = Tuple[List[List[int]], pd.DataFrame]

0 commit comments

Comments
 (0)