Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=40.6.0", "wheel", "numpy", "scipy"]
build-backend = "setuptools.build_meta"
2 changes: 1 addition & 1 deletion sliced/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def slice_y(y, n_slices=10):
slice_partition.append(n_samples_seen)

# turn partitions into an indicator
slice_indicator = np.ones(y.shape[0], dtype=np.int)
slice_indicator = np.ones(y.shape[0], dtype=int)
for j, (start_idx, end_idx) in enumerate(
zip(slice_partition, slice_partition[1:])):

Expand Down
17 changes: 9 additions & 8 deletions sliced/externals/sklearn_partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import numpy as np
import scipy.sparse as sp
from numpy.core.numeric import ComplexWarning


class NotFittedError(ValueError, AttributeError):
Expand Down Expand Up @@ -368,13 +367,15 @@ def check_array(array, accept_sparse=False, dtype="numeric", order=None,
# dtype to the function converts complex to real dtype,
# thereby passing the test made in the lines following the scope
# of warnings context manager.
with warnings.catch_warnings():
try:
warnings.simplefilter('error', ComplexWarning)
array = np.asarray(array, dtype=dtype, order=order)
except ComplexWarning:
raise ValueError("Complex data not supported\n"
"{}\n".format(array))
#with warnings.catch_warnings():
# try:
# warnings.simplefilter('error', ComplexWarning)
# array = np.asarray(array, dtype=dtype, order=order)
# except ComplexWarning:
# raise ValueError("Complex data not supported\n"
# "{}\n".format(array))

# skip for numpy 2

# It is possible that the np.array(..) gave no warning. This happens
# when no dtype conversion happened, for example dtype = None. The
Expand Down