Skip to content

Add compare_weights: order-agnostic weights file comparison (6)#89

Open
cattabiani wants to merge 5 commits into
katta/multi-electrode-weightsfrom
katta/compare-weights
Open

Add compare_weights: order-agnostic weights file comparison (6)#89
cattabiani wants to merge 5 commits into
katta/multi-electrode-weightsfrom
katta/compare-weights

Conversation

@cattabiani

@cattabiani cattabiani commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Fix: #88
Fix: #85

Adds a public compare_weights function and CLI command for order-agnostic comparison of weights H5 files.

Changes

  • bluerecording/compare.pycompare_weights(reference, target, rtol, atol, population_name) returns (bool, report_str)
  • CLIbluerecording compare_weights ref.h5 new.h5 --rtol 1e-6 --atol 1e-9 (exit 0 = match, 1 = mismatch)
  • Refactored integration tests — replaced 5 duplicated _get_node_scaling_factors helpers with one compare_weights call each
  • Unit tests — matching, order-agnostic matching, mismatched values, mismatched node_ids

Usage

Python:

from bluerecording import compare_weights

match, report = compare_weights("reference.h5", "new.h5")
print(report)

CLI:

bluerecording compare_weights reference.h5 new.h5

@cattabiani cattabiani self-assigned this Jun 24, 2026
@cattabiani cattabiani changed the title Add compare_weights: order-agnostic weights file comparison Add compare_weights: order-agnostic weights file comparison (6) Jun 25, 2026
@cattabiani cattabiani requested review from WeinaJi and mgeplf June 25, 2026 07:14
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