Skip to content

Commit 710d34e

Browse files
authored
Move APIs (#12)
1 parent 7bc11f9 commit 710d34e

File tree

9 files changed

+27
-11
lines changed

9 files changed

+27
-11
lines changed

docs/index.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
:members:
66

77

8-
``fast_array_utils.scipy``
9-
--------------------------
8+
``fast_array_utils.conv``
9+
-------------------------
1010

11-
.. automodule:: fast_array_utils.scipy
11+
.. automodule:: fast_array_utils.conv
1212
:members:
13+
14+
15+
``fast_array_utils.types``
16+
--------------------------
17+
18+
.. automodule:: fast_array_utils.types
19+
:members: OutOfCoreDataset

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ run.data_file = "test-data/.coverage"
111111
xml.output = "test-data/coverage.xml"
112112
html.directory = "test-data/htmlcov"
113113
run.omit = [ "src/testing/*", "tests/*" ]
114-
report.exclude_also = [ "if TYPE_CHECKING:", "@numba.njit" ]
114+
report.exclude_also = [ "if TYPE_CHECKING:", "@numba[.]njit", "[.]{3}" ]
115115

116116
[tool.mypy]
117117
strict = true

src/fast_array_utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from __future__ import annotations
55

6-
from ._asarray import OutOfCoreDataset, asarray
6+
from . import conv, types
77

88

9-
__all__ = ["OutOfCoreDataset", "asarray"]
9+
__all__ = ["conv", "types"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
"""Conversion utilities."""
3+
4+
from __future__ import annotations
5+
6+
from ._asarray import asarray
7+
8+
9+
__all__ = ["asarray"]

src/fast_array_utils/_asarray.py renamed to src/fast_array_utils/conv/_asarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import numpy as np
88

9-
from .types import CSBase, CupyArray, CupySparseMatrix, DaskArray, H5Dataset, OutOfCoreDataset
9+
from ..types import CSBase, CupyArray, CupySparseMatrix, DaskArray, H5Dataset, OutOfCoreDataset
1010

1111

1212
if TYPE_CHECKING:

src/fast_array_utils/scipy/_to_dense.py renamed to src/fast_array_utils/conv/scipy/_to_dense.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
from numpy.typing import NDArray
1414

15-
from ..types import CSBase
15+
from ...types import CSBase
1616

1717
DT_co = TypeVar("DT_co", bound=np.generic, covariant=True)
1818
DT = TypeVar("DT", bound=np.generic)
@@ -41,7 +41,7 @@ def to_dense(x: CSBase[DT_co], order: Literal["C", "F"] = "C") -> NDArray[DT_co]
4141
_to_dense_csr_numba(x.indptr, x.indices, x.data, out)
4242
elif x.format == "csc":
4343
_to_dense_csc_numba(x.indptr, x.indices, x.data, out)
44-
else:
44+
else: # pragma: no cover
4545
out = x.toarray(order=order)
4646
return out
4747

tests/test_asarray.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88
import pytest
99

10-
from fast_array_utils._asarray import asarray
10+
from fast_array_utils.conv import asarray
1111

1212

1313
if TYPE_CHECKING:

tests/test_sparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88
import pytest
99

10-
from fast_array_utils.scipy import to_dense
10+
from fast_array_utils.conv.scipy import to_dense
1111

1212

1313
if TYPE_CHECKING:

0 commit comments

Comments
 (0)