Skip to content

Numpy 2 compat, scipy sparse arrays, and python version floor bump#160

Open
NDevanathan wants to merge 2 commits into
JamesYang007:mainfrom
NDevanathan:main
Open

Numpy 2 compat, scipy sparse arrays, and python version floor bump#160
NDevanathan wants to merge 2 commits into
JamesYang007:mainfrom
NDevanathan:main

Conversation

@NDevanathan

@NDevanathan NDevanathan commented May 9, 2026

Copy link
Copy Markdown

This pull request updates the package to support numpy>=2.0.0 and the new scipy.sparse.csr_array and csc_array types in addition to the traditional csr_matrix and csc_matrix types. It also updates the package version to 2.0.0.dev, since there's consequently some minor changes in the interface (output types and property types) and the dep floor was raised.

#152 #148

Support for scipy.sparse array types:

  • Added support for csr_array and csc_array throughout the codebase, including type annotations, runtime checks, and documentation in adelie/constraint.py, adelie/diagnostic.py, and adelie/matrix.py. This allows users to pass either the new array-based or the classic matrix-based sparse types.

API and documentation consistency:

  • Updated all relevant docstrings and error messages to mention support for both array and matrix sparse types, improving clarity for users.

Versioning and maintenance:

  • Bumped the package version to 2.0.0.dev in adelie/__init__.py to signal a breaking or significant change in the API.

Array handling improvements:

  • Improved handling of the copy parameter for array construction, using copy=copy or None to avoid unnecessary copies and potential issues.

Minor fixes:

  • Updated the installation link in README.md to point to the correct location in the documentation.
  • Used np.asarray instead of np.array where appropriate for better handling of input types.

These changes ensure that the package remains compatible with the latest versions of SciPy and continues to provide a consistent and user-friendly API for both classic and new sparse matrix types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant