Skip to content

Fix several mmread/mminfo bugs - #66

Merged
ViralBShah merged 3 commits into
masterfrom
vs/read-fixes
Oct 27, 2026
Merged

ViralBShah merged 3 commits into
masterfrom
vs/read-fixes

Conversation

@ViralBShah

Copy link
Copy Markdown
Member

Fixes:

  • mmread(file, false, true) returned the header tuple instead of the coordinates, because retcoord was passed into the infoonly slot.
  • Complex symmetric matrices came back conjugated. Symmetric now mirrors with transpose, hermitian with adjoint, and skew-symmetric with -transpose.
  • Dense array files with symmetric, hermitian or skew-symmetric storage crashed. They store only the lower triangle.
  • Dense complex arrays crashed. Dense pattern arrays now throw FileFormatException.
  • A file truncated after the header made mminfo/mmread loop forever.
  • Filename methods accept any AbstractString and close the file and gzip stream on error.
  • Non-square matrices declared as symmetric now throw FileFormatException.

Dense integer arrays still read as Float64, to avoid a breaking change.

Adds offline tests in test/read.jl.

🤖 Generated with Claude Code

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.82%. Comparing base (0dc2453) to head (6ec3974).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
+ Coverage   89.40%   94.82%   +5.42%     
==========================================
  Files           4        4              
  Lines         151      174      +23     
==========================================
+ Hits          135      165      +30     
+ Misses         16        9       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ViralBShah and others added 3 commits October 27, 2026 09:46
…tring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pass infoonly/retcoord through correctly when reading by filename, accept
  any AbstractString, and close the file on error via open_mm.
- Expand symmetric matrices with transpose, hermitian with adjoint and
  skew-symmetric with -transpose, so complex symmetric input is no longer
  conjugated. In-place broadcasting keeps the element type (Bool stays Bool).
- Read only the stored lower triangle of symmetric, hermitian and
  skew-symmetric dense arrays instead of rows*cols values.
- Parse complex dense arrays, keep real/integer dense arrays as Float64,
  reject pattern arrays, and tolerate surrounding whitespace and CRLF.
- Add offline tests in test/read.jl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ViralBShah
ViralBShah merged commit c6f99d1 into master Oct 27, 2026
7 checks passed
@ViralBShah
ViralBShah deleted the vs/read-fixes branch October 27, 2026 13:48
@ViralBShah
ViralBShah restored the vs/read-fixes branch October 27, 2026 13:50
@ViralBShah
ViralBShah deleted the vs/read-fixes branch October 27, 2026 13:50
ViralBShah referenced this pull request Oct 27, 2026
Speed up mmread/mmwrite (≈3× faster sparse reads)
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