Skip to content

Fix matrix sparsity analysis input handling#5557

Open
fallintoplace wants to merge 3 commits into
rapidsai:mainfrom
fallintoplace:fix-analyse-mtx-sparsity
Open

Fix matrix sparsity analysis input handling#5557
fallintoplace wants to merge 3 commits into
rapidsai:mainfrom
fallintoplace:fix-analyse-mtx-sparsity

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • Move the Matrix Market CSR conversion back onto the valid-input path.
  • Return a nonzero exit code and write usage errors to stderr when no matrix path is provided.

Why

analyse_mtx_sparsity.py only assigned M inside the if M_in is None branch, after a raise. For valid inputs, the first M.has_sorted_indices access raised NameError before any sparsity analysis could run.

Validation

  • python3 -m py_compile python/utils/analyse_mtx_sparsity.py
  • No-argument invocation exits with status 1 and prints the usage error.
  • Smoke-tested a tiny temporary Matrix Market file with NumPy, SciPy, NetworkX 2.8.8, and Matplotlib.

@fallintoplace fallintoplace requested a review from a team as a code owner June 11, 2026 16:52
@copy-pr-bot

copy-pr-bot Bot commented Jun 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Comment thread python/utils/analyse_mtx_sparsity.py Outdated
@ChuckHastings ChuckHastings added bug Something isn't working non-breaking Non-breaking change python labels Jul 13, 2026
@ChuckHastings

Copy link
Copy Markdown
Collaborator

/okay to test f06564e

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

Labels

bug Something isn't working non-breaking Non-breaking change python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants