Skip to content

Commit 585f416

Browse files
committed
Fix imports
1 parent 0d9b682 commit 585f416

9 files changed

Lines changed: 15 additions & 11 deletions

File tree

scself/_noise2self/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _noise_to_self_error(
147147

148148
if (metric == 'mse' and is_csr(X)):
149149

150-
from ..sparse.graph import chunk_graph_mse
150+
from scself.sparse.graph import chunk_graph_mse
151151

152152
_n_row = X.shape[0]
153153

scself/_noise2self/graph.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from sklearn.neighbors import NearestNeighbors
77

88
from scself.sparse import is_csr
9-
from scself.sparse.graph import _shrink_sparse_graph_k
109
from scself.utils import array_sum, dot
1110

1211

@@ -61,6 +60,8 @@ def _nn_slice(k, n):
6160
_smallest = keep == 'smallest'
6261

6362
if neighbor_sparse:
63+
from scself.sparse.graph import _shrink_sparse_graph_k
64+
6465
_shrink_sparse_graph_k(
6566
neighbor_graph.data,
6667
neighbor_graph.indptr,
@@ -250,7 +251,7 @@ def _row_divide(arr, row_divide_vector):
250251
# Numba function for CSR
251252
# more memory efficient
252253
if is_csr(arr):
253-
from ..sparse.math import _csr_row_divide
254+
from scself.sparse.math import _csr_row_divide
254255

255256
_csr_row_divide(
256257
arr.data,

scself/scaling/truncscaler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def fit(self, X, y=None):
1616
# Use custom extractor to turn X into a CSC with no
1717
# indices array; RobustScaler makes an undesirabe
1818
# CSR->CSC conversion
19-
from ..sparse.math import sparse_csr_extract_columns
19+
from scself.sparse.math import sparse_csr_extract_columns
2020
super().fit(
2121
sparse_csr_extract_columns(X, fake_csc_matrix=True),
2222
y

scself/tests/test_mkl_hacks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
DATA = np.random.default_rng(100).random((100, 50)).astype(np.float32)
1515

1616

17-
@unittest.skipIf(MKL_SKIP, 'NO MKL')
17+
@unittest.skip
1818
class TestTruncatedSVDMKL(unittest.TestCase):
1919

2020
@unittest.skipIf('CI' in os.environ, 'Skip for CI')

scself/utils/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
coefficient_of_variation,
1212
variance
1313
)
14-
from ._pca import pca
14+
from ._pca import (
15+
pca,
16+
stratified_pca
17+
)
1518
from .shrink import shrink_array_to_zero_inplace
1619
from .cast_dtype_inplace import cast_to_float_inplace
1720
from .correlation import (

scself/utils/correlation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def correlation_clustering_and_umap(
9797
obs=pd.DataFrame(index=var_names) if var_names is not None else None
9898
)
9999

100-
# Special case handling when there are too many neighbors for
100+
# Special case handling to silently handle when there are too many neighbors for
101101
# the provided data; comes up with submodules a lot
102102
if corr_dist_adata.shape[0] <= n_neighbors:
103103

scself/utils/pairwise_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def mcv_mean_error(
215215

216216
if sps.issparse(x):
217217

218-
from ..sparse.math import mcv_mean_error_sparse
218+
from scself.sparse.math import mcv_mean_error_sparse
219219

220220
return mcv_mean_error_sparse(
221221
x,

scself/utils/standardization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _normalize(
9898
)
9999

100100
elif is_csr(lref):
101-
from ..sparse.math import sparse_normalize_total
101+
from scself.sparse.math import sparse_normalize_total
102102
sparse_normalize_total(
103103
lref,
104104
size_factor=size_factor
@@ -133,7 +133,7 @@ def _normalize(
133133
scaler.scale_ = scale_factor
134134

135135
if is_csr(lref):
136-
from ..sparse.math import sparse_normalize_columns
136+
from scself.sparse.math import sparse_normalize_columns
137137
sparse_normalize_columns(
138138
lref,
139139
scaler.scale_

scself/utils/sum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def array_sum(array, axis=None, squared=False):
3131
# Because the scipy sparse method here is
3232
# very memory inefficient
3333
else:
34-
from ..sparse.math import sparse_sum
34+
from scself.sparse.math import sparse_sum
3535

3636
return sparse_sum(
3737
array,

0 commit comments

Comments
 (0)