Skip to content

Releases: scigolib/matlab

v0.3.9

18 Mar 18:30
fcd11cc

Choose a tag to compare

Changed

  • HDF5 dependency: Updated from v0.13.11 to v0.13.13
  • No breaking changes

v0.3.8

14 Mar 12:50
4544521

Choose a tag to compare

Changed

  • HDF5 dependency: Updated from v0.13.10 to v0.13.11
  • No breaking changes

v0.3.7

07 Mar 05:48
8882365

Choose a tag to compare

Changed

  • HDF5 dependency: Updated from v0.13.8 to v0.13.10
  • Linter config: Excluded gosec G115 globally (intentional signed/unsigned conversions for MATLAB binary format)
  • Removed stale //nolint:gosec inline directives from types.go and writer.go
  • No breaking changes

v0.3.6

04 Mar 08:12
eb9aaa8

Choose a tag to compare

Changed

  • HDF5 dependency: Updated from v0.13.7 to v0.13.8
  • CI: Removed duplicate workflow runs for feature/hotfix/release branches
  • README: Updated coverage info (92.8%)
  • No breaking changes

v0.3.5

28 Feb 18:53
2ed0c42

Choose a tag to compare

Changed

  • HDF5 dependency: Updated from v0.13.5 to v0.13.7
  • Test coverage: Improved from 51% to 92.8% (awesome-go >= 90% requirement)
  • README: Added Codecov badge
  • No breaking changes

Added

  • internal/v5/parser_test.go - 35 roundtrip and error path tests for v5 parser
  • internal/v5/compressed_test.go - 5 tests for zlib decompression
  • internal/v73/adapter_test.go - 9 tests for HDF5-to-MATLAB conversion
  • internal/v73/parser_test.go - 8 tests for v73 reader path
  • types/array_test.go - 8 tests for NumericArray and CharArray

Quality

  • Tests: 228 passing, 5 skipped (known HDF5 library limitations)
  • Coverage by package: v5 98.5%, types 100%, root 95.8%, v73 76.1%
  • Combined library coverage: 92.8%

v0.3.4

02 Feb 11:52
d5d8678

Choose a tag to compare

What's Changed

Dependencies

  • Update github.com/scigolib/hdf5 from v0.13.3 to v0.13.5

Notes

  • No breaking changes
  • All existing functionality preserved
  • All tests passing (298+ tests)

Full Changelog: v0.3.3...v0.3.4

v0.3.3

27 Jan 22:14
951f66c

Choose a tag to compare

What's Changed

Dependencies

  • Update github.com/scigolib/hdf5 from v0.13.2 to v0.13.3

Notes

  • No breaking changes
  • All existing functionality preserved
  • All tests passing (298+ tests)

Full Changelog: v0.3.2...v0.3.3

v0.3.2

17 Jan 21:25

Choose a tag to compare

What's Changed

Dependencies

  • Update github.com/scigolib/hdf5 from v0.13.1 to v0.13.2

Notes

  • No breaking changes
  • All existing functionality preserved
  • All tests passing (298+ tests)

Full Changelog: v0.3.1...v0.3.2

v0.3.1 - Critical Bug Fixes (Hotfix)

25 Nov 20:21

Choose a tag to compare

Critical Bug Fixes

This hotfix release addresses three critical bugs that prevented reading most real-world MATLAB v5 files.

Bug Fixes

1. Compressed Data Support (Critical)

  • Issue: Files with zlib-compressed data (miCOMPRESSED) returned 0 variables
  • Impact: Most real-world MATLAB files use compression - they were unreadable
  • Fix: Implemented full zlib decompression with compression bomb protection

2. Endianness Interpretation (Critical)

  • Issue: 'MI'/'IM' endian indicators were interpreted incorrectly (swapped)
  • Impact: Wrong byte order caused garbage data or parse failures
  • Fix: Corrected to match MATLAB specification ('IM' = little-endian, 'MI' = big-endian)

3. Small Format Tag Data (Critical)

  • Issue: Small format tags (1-4 bytes) lost their embedded data
  • Impact: Variable names and small arrays were corrupted
  • Fix: Added proper handling for data embedded in tag bytes

Verification

  • All 298+ existing tests pass
  • Tested with real scientific data files (12 and 34 variables)
  • CI passed on all platforms (Ubuntu, macOS, Windows)

Upgrade

go get github.com/scigolib/matlab@v0.3.1

Full Changelog: v0.3.0...v0.3.1

v0.3.0 MATLAB File Reader/Writer - Production Quality

22 Nov 10:55

Choose a tag to compare

Production Quality Release

This release brings the library to production quality (Grade A-) with critical security fixes, modern API design, and comprehensive testing.

🎯 Key Features

Functional Options Pattern:

  • WithEndianness(binary.ByteOrder) - Set byte order for v5 files
  • WithDescription(string) - Set custom file description
  • WithCompression(int) - Set compression level 0-9
  • 100% backward compatible with existing API

API Convenience Methods (70% less boilerplate):

  • MatFile.GetVariable(name) - Direct variable access by name
  • MatFile.GetVariableNames() - Get list of all variables
  • MatFile.HasVariable(name) - Check if variable exists
  • Variable.GetFloat64Array() - Type-safe float64 extraction
  • Variable.GetInt32Array() - Type-safe int32 extraction
  • Variable.GetComplex128Array() - Complex number extraction
  • Variable.GetScalar() - Extract single scalar value

Testable Examples:

  • 17 godoc examples with real, executable code
  • All examples verified by go test
  • Always-current documentation

🔒 Security Fixes

Security Fix #1: Tag Size Validation (High Priority):

  • Issue: No validation on v5 tag sizes - potential memory exhaustion attack
  • Impact: Malicious MAT files could specify huge sizes (4GB+)
  • Fix: Added 2GB limit in internal/v5/data_tag.go:53

Security Fix #2: Dimension Overflow Check (High Priority):

  • Issue: No overflow check when calculating total array size
  • Impact: Integer overflow could lead to incorrect buffer allocation
  • Fix: Added math.MaxInt check in internal/v5/writer.go:124 and internal/v73/writer.go:98

Security Fix #3: v73 Complex Reading (Functionality):

  • Issue: v73 complex number groups not properly detected during reading
  • Impact: Round-trip failures for complex numbers in v7.3 format
  • Fix: Added MATLAB_complex attribute detection in internal/v73/adapter.go:50

📊 Quality Metrics

  • Grade: A- (Excellent) - Production Quality ⬆️
  • Tests: 298 passing (100%) (+60 tests from v0.2.0)
  • Coverage: 85.4% (+6.9% from v0.2.0)
  • Linter: 0 errors, 0 warnings
  • CI/CD: All checks GREEN on all platforms

✨ What's Included

  • v5 Writer: Complete (all numeric types, complex, multi-dimensional)
  • v7.3 Writer: Complete (HDF5-based)
  • v5 Reader: Full support with critical bug fixes
  • v7.3 Reader: Full HDF5 integration
  • Round-trip verified: Both formats working perfectly
  • Cross-platform: Windows, Linux, macOS

📦 Installation

go get github.com/scigolib/matlab

📚 Documentation

🔄 Upgrade from v0.2.0

100% backward compatible - no breaking changes. Simply update your dependency:

go get -u github.com/scigolib/matlab

See CHANGELOG.md for complete details.