Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT Removes ReadOnlyWrapper #25586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
"sklearn.utils._logistic_sigmoid",
"sklearn.utils._openmp_helpers",
"sklearn.utils._random",
"sklearn.utils._readonly_array_wrapper",
"sklearn.utils._seq_dataset",
"sklearn.utils._sorting",
"sklearn.utils._typedefs",
Expand Down Expand Up @@ -455,7 +454,6 @@ def check_package_status(package, min_version):
},
{"sources": ["_random.pyx"], "include_np": True},
{"sources": ["_logistic_sigmoid.pyx"], "include_np": True},
{"sources": ["_readonly_array_wrapper.pyx"], "include_np": True},
{"sources": ["_typedefs.pyx"], "include_np": True},
{"sources": ["_heap.pyx"], "include_np": True},
{"sources": ["_sorting.pyx"], "include_np": True},
Expand Down
67 changes: 0 additions & 67 deletions sklearn/utils/_readonly_array_wrapper.pyx

This file was deleted.

41 changes: 0 additions & 41 deletions sklearn/utils/tests/test_readonly_wrapper.py

This file was deleted.

21 changes: 0 additions & 21 deletions sklearn/utils/tests/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from sklearn.utils.deprecation import deprecated
from sklearn.utils.metaestimators import available_if, if_delegate_has_method
from sklearn.utils._readonly_array_wrapper import _test_sum
from sklearn.utils._testing import (
assert_raises,
assert_no_warnings,
Expand Down Expand Up @@ -680,26 +679,6 @@ def test_create_memmap_backed_data(monkeypatch, aligned):
create_memmap_backed_data([input_array, "not-an-array"], aligned=True)


@pytest.mark.parametrize("dtype", [np.float32, np.float64, np.int32, np.int64])
def test_memmap_on_contiguous_data(dtype):
"""Test memory mapped array on contiguous memoryview."""
x = np.arange(10).astype(dtype)
assert x.flags["C_CONTIGUOUS"]
assert x.flags["ALIGNED"]

# _test_sum consumes contiguous arrays
# def _test_sum(NUM_TYPES[::1] x):
sum_origin = _test_sum(x)

# now on memory mapped data
# aligned=True so avoid https://github.com/joblib/joblib/issues/563
# without alignment, this can produce segmentation faults, see
# https://github.com/scikit-learn/scikit-learn/pull/21654
x_mmap = create_memmap_backed_data(x, mmap_mode="r+", aligned=True)
sum_mmap = _test_sum(x_mmap)
assert sum_mmap == pytest.approx(sum_origin, rel=1e-11)


@pytest.mark.parametrize(
"constructor_name, container_type",
[
Expand Down