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

Skip to content

TST Extend tests for scipy.sparse.*array #27090

Closed
@jjerphan

Description

@jjerphan

SciPy sparse matrices (i.e. scipy.sparse.*matrix) are tested but their sparse arrays counterpart (i.e. scipy.sparse.*array) aren't yet will become ubiquitous (see #26418).

Tests and their parameterizations (when they exist) must be adapted to include scipy.sparse.*array conditionally to versions of SciPy that support them (i.e. scipy>=1.8).

Steps

ℹ️ You can take #27095 as an example for your PRs.

1. Choose one of the files to adapt

  • Indicate the file you are adapting (later referred to as <filename>) on this issue so no-one ends up duplicating work. E.g.
Hi, I am starting working on `<filename>`.

Please double check as this list might be outdated, but candidate files might be:

2. Perform the following (non-exhaustive) changes for <filename>

  • Add test parametrization for tests using *_matrix (for instance see eda7b16)
  • Adapt existing test parametrization to test against sparse array (for instance see 6717f99)
  • Extend or add test checking that type of sparse containers are preserve by functions. E.g. adding tests like (as proposed by TST Extend tests for scipy.sparse.*array #27090 (comment)):
    sparse_input = sparse_container(...)
    sparse_output = process_sparse_container(sparse_input)
    
    assert isinstance(sparse_output, type(sparse_input))
  • Run tests for this file:
    # Run all the test in <filename>
    pytest <filename> -k test_to_run
    
    # Run a specific test in this file
    pytest <filename> -k test_to_run
    
  • If tests fail, the tested implementations has to be adapted (let us know if you need help)

3. Create a pull request

  • Use this title:
TST Extend tests for `scipy.sparse.*array` in `<filename>`
  • Mention this issue in its description:
Towards #27090.

4. Once the pull request is created

  • Ignore the error on the CI related the changelog: those PR need not update the changelog since nothing has changed for the users (until this issue is resolved), and maintainers must label PRs as "No Changelog Needed" for the check to be deactivated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Meta-issueGeneral issue associated to an identified list of tasksSprintgood first PR to reviewSimple atomic PR to reviewmodule:test-suiteeverything related to our tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions