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

Skip to content

CI Adapt handling of discarded fused typed memoryview #25425

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

Conversation

jjerphan
Copy link
Member

@jjerphan jjerphan commented Jan 18, 2023

Reference Issues/PRs

Partially address #25202 by making the following tests pass on [scipy-dev]:

Resolved tests
 → pytest sklearn/datasets/tests/test_svmlight_format.py -v --lf                                                                                                                                                                                              
==================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.11.0, pytest-7.2.0, pluggy-1.0.0 -- /home/jjerphan/.local/share/miniconda3/envs/sk/bin/python3.11                                                                                                                                  
cachedir: .pytest_cache                                                                                                                                                                                                                                       
rootdir: /home/jjerphan/dev/scikit-learn, configfile: setup.cfg                                                                                                                                                                                               
plugins: anyio-3.6.2                                                                                                                                                                                                                                          
collected 57 items / 21 deselected / 36 selected                                                                                                                                                                                                              
run-last-failure: rerun previous 36 failures                                                                                                                                                                                                                  
                                                                                                                                                                                                                                                              
sklearn/datasets/tests/test_svmlight_format.py::test_dump PASSED                                                                                                                                                                                       [  2%] 
sklearn/datasets/tests/test_svmlight_format.py::test_dump_multilabel PASSED                                                                                                                                                                            [  5%] 
sklearn/datasets/tests/test_svmlight_format.py::test_dump_concise PASSED                                                                                                                                                                               [  8%] 
sklearn/datasets/tests/test_svmlight_format.py::test_dump_comment PASSED                                                                                                                                                                               [ 11%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_zeros PASSED                                                                                                                                                                                 [ 13%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-13-0] PASSED                                                                                                                                                                  [ 16%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-13-0.1] PASSED                                                                                                                                                                [ 19%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-13-0.5] PASSED                                                                                                                                                                [ 22%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-13-0.99] PASSED                                                                                                                                                               [ 25%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-13-1] PASSED                                                                                                                                                                  [ 27%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-101-0] PASSED                                                                                                                                                                 [ 30%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-101-0.1] PASSED                                                                                                                                                               [ 33%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-101-0.5] PASSED                                                                                                                                                               [ 36%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-101-0.99] PASSED                                                                                                                                                              [ 38%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[2-101-1] PASSED                                                                                                                                                                 [ 41%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-13-0] PASSED                                                                                                                                                                  [ 44%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-13-0.1] PASSED                                                                                                                                                                [ 47%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-13-0.5] PASSED                                                                                                                                                                [ 50%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-13-0.99] PASSED                                                                                                                                                               [ 52%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-13-1] PASSED                                                                                                                                                                  [ 55%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-101-0] PASSED                                                                                                                                                                 [ 58%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-101-0.1] PASSED                                                                                                                                                               [ 61%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-101-0.5] PASSED                                                                                                                                                               [ 63%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-101-0.99] PASSED                                                                                                                                                              [ 66%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[7-101-1] PASSED                                                                                                                                                                 [ 69%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-13-0] PASSED                                                                                                                                                                 [ 72%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-13-0.1] PASSED                                                                                                                                                               [ 75%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-13-0.5] PASSED                                                                                                                                                               [ 77%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-13-0.99] PASSED                                                                                                                                                              [ 80%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-13-1] PASSED                                                                                                                                                                 [ 83%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-101-0] PASSED                                                                                                                                                                [ 86%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-101-0.1] PASSED                                                                                                                                                              [ 88%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-101-0.5] PASSED                                                                                                                                                              [ 91%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-101-0.99] PASSED                                                                                                                                                             [ 94%] 
sklearn/datasets/tests/test_svmlight_format.py::test_load_with_offsets[41-101-1] PASSED                                                                                                                                                                [ 97%] 
sklearn/datasets/tests/test_svmlight_format.py::test_multilabel_y_explicit_zeros PASSED                                                                                                                                                                [100%] 
                                                                                                                                                                                                                                                              
======================================================================================================= 36 passed, 21 deselected, 14 warnings in 0.11s =======================================================================================================

What does this implement/fix? Explain your changes.

As of Cython>=3.0, memory views can't be None otherwise the runtime would not know which concrete implementation to dispatch the Python call to.

This simply adapt a call to pass an empty numpy array to resolve the concrete implementation of Cython functions using fused-types.

As of Cython>=3.0, memory views can't be None otherwise the runtime
would not know which concrete implementation to dispatch the Python
call to.

This simply adapt a call to pass an empty numpy array to resolve
the concrete implementation of Cython functions using fused-types.
@jjerphan jjerphan added Build / CI cython Quick Review For PRs that are quick to review labels Jan 18, 2023
Copy link
Member

@ogrisel ogrisel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am ok with the spirit of the fix as I don't see a better option than passing an empty array. It feels a bit like a slight Cython usability regression but I can live with it.

@jjerphan
Copy link
Member Author

jjerphan commented Jan 18, 2023

I am ok with the spirit of the fix as I don't see a better option than passing an empty array. It feels a bit like a slight Cython usability regression but I can live with it.

I agree and I think the best would be to simplify those implementations.

Also IIRC, some handling in #13649 might be invalidated by this change of behavior.

@jjerphan jjerphan added the Waiting for Second Reviewer First reviewer is done, need a second one! label Jan 18, 2023
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm okay with this work around. The failing [scipy-dev] CI are unrelated to this PR so I am merging.

LGTM

@thomasjpfan thomasjpfan merged commit f1340c7 into scikit-learn:main Jan 18, 2023
@jjerphan jjerphan deleted the ci/adapt-handling-around-discarded-fusedtyped-memoryview branch January 18, 2023 12:54
jjerphan added a commit to jjerphan/scikit-learn that referenced this pull request Jan 20, 2023
jjerphan added a commit to jjerphan/scikit-learn that referenced this pull request Jan 20, 2023
jjerphan added a commit to jjerphan/scikit-learn that referenced this pull request Jan 23, 2023
adrinjalali pushed a commit that referenced this pull request Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build / CI cython module:datasets Quick Review For PRs that are quick to review Waiting for Second Reviewer First reviewer is done, need a second one!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants