Skip to content

fix(cyclers): reject ambiguous wildcard unit columns - #418

Merged
Tom Holland (tomjholland) merged 1 commit into
ImperialCollegeLondon:mainfrom
VolMax-Studio:fix/ambiguous-wildcard-unit-columns
Nov 18, 2026
Merged

Tom Holland (tomjholland) merged 1 commit into
ImperialCollegeLondon:mainfrom
VolMax-Studio:fix/ambiguous-wildcard-unit-columns

Conversation

@VolMax-Studio

Copy link
Copy Markdown
Contributor

Fixes #417.

Problem

ColumnMap.match_columns() iterates a set of available column names and overwrites wildcard matches. When a BioLogic multi-file import contains both Q charge/mA.h and Q charge/A.h, the chosen capacity column depends on PYTHONHASHSEED, silently omitting data from whichever file used the other unit.

Change

Fail closed when more than one distinct valid column matches the same wildcard pattern. Include the affected PyProBE quantity, pattern, and sorted matching column names in the error.

This deliberately does not attempt to coalesce or normalize the mixed columns: combining their counters correctly requires additional semantics beyond a simple column lookup. Exact matches and unambiguous wildcard matches remain supported; repeated identical column names are not treated as multiple candidates.

Regression coverage

  • Both orders of competing Q charge/* unit columns fail explicitly instead of selecting a hash-dependent winner.
  • Repeated identical column names remain unambiguous.
  • A synthetic two-file BioLogic MB import with mixed mA.h and A.h charge counters now rejects the ambiguous mapping before producing an incorrect Capacity [Ah] series.

On unmodified main at bea49c1b3d5049f520678de0cb4f4a7f4a5c4504, 3 new targeted cases failed. With the fix:

  • Full pytest suite: 263 passed, 6 skipped.
  • ruff check and ruff format --check on all changed files: passed.

The skipped tests are existing optional plot tests; documentation notebook tests were not run.

Signed-off-by: VolMax-Studio <volmax.core@gmail.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.44%. Comparing base (bea49c1) to head (9e4d3ec).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
+ Coverage   95.42%   95.44%   +0.02%     
==========================================
  Files          58       58              
  Lines        5003     5027      +24     
==========================================
+ Hits         4774     4798      +24     
  Misses        229      229              

☔ 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.

@tomjholland Tom Holland (tomjholland) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VolMax-Studio (@VolMax-Studio) Thanks for this! I think the ideal end solution is for the normalisation to happen before the data frames are combined, but I see why you avoided that for now; this fix is helpful on its own.

@tomjholland
Tom Holland (tomjholland) merged commit 755bb00 into ImperialCollegeLondon:main Nov 18, 2026
8 checks passed
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.

Ambiguous unit-column matching in multi-file BioLogic imports produces hash-seed-dependent capacity

3 participants