Skip to content

Conversation

@jorenham
Copy link
Member

Closes #817

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes and improves the type annotations for the lil_matrix and lil_array constructors in the scipy sparse module. The changes address issue #817 by refining type handling and constructor overloads.

Key changes include:

  • Replaced op.CanIndex and op.JustInt/JustFloat/JustComplex with standard library equivalents (SupportsIndex, int, float, complex)
  • Added new type alias _ToAnyLIL to better handle constructor arguments
  • Enhanced constructor overloads for better dtype inference with specific numeric types
  • Added comprehensive test coverage for the improved constructors

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
scipy-stubs/sparse/_lil.pyi Improves type annotations for lil_matrix and lil_array constructors, replaces optype dependencies with standard library types, and adds new overloads for better dtype handling
tests/sparse/test_lil.pyi Adds comprehensive type tests for the improved lil_matrix and lil_array constructors covering various input types and dtype specifications

@jorenham jorenham requested a review from Copilot August 18, 2025 17:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jorenham jorenham merged commit 190e645 into master Aug 18, 2025
21 checks passed
@jorenham jorenham deleted the gh-817 branch August 18, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No override for lil_matrix.__init__(arg1, dtype)

2 participants