Skip to content

fix: the EDS metadata tree is one FormatoHSPY can write, and the sparse store checks its channel order - #186

Merged
Paullo9 merged 1 commit into
mainfrom
claude/project-thread-b2qyav
Nov 27, 2026
Merged

Paullo9 merged 1 commit into
mainfrom
claude/project-thread-b2qyav

Conversation

@Paullo9

@Paullo9 Paullo9 commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Requested by Paul · project thread

Fixes #185

These fixes come from the independent review of #183, made before 0.24.0 ships. The review found no change to any decoded number.

  • Metadata tree:
    • Acquisition_instrument is no longer written as a value beside its own SEM/TEM group, which FormatoHSPY refused (conflictingMetadataKeys), so every EDS signal could not be saved as .hspy.
    • The mode is now the name of the one group under it, as in RosettaSciIO's tree. Where no instrument field is known, the key names the mode itself, since it then has no group to clash with.
    • EDSMetadata(_:) reads the mode either way, so the parity tests' metadata stays the same.
  • EDSSparseSpectrumImage.init: refuses a pixel that lists a channel out of order or twice (.damaged), so read(start:count:) and sum always see the same counts. The kit's readers already build ascending channels.
  • docs/parity.md: a Bruker dense slab with a count past the dtype from RosettaSciIO's estimate_map_depth is refused, where upstream's unbcf_fast wraps. The dtype stays upstream's.

New tests in EDSMetadataTreeTests:

  • no key is both a value and a group, and the fields round-trip, with and without instrument fields;
  • channels out of order or repeated are refused.

Unbuilt in the cloud, so CI is the build.


Generated by Claude Code

…se store checks its channel order

The mode is the name of the one group under Acquisition_instrument, as in
RosettaSciIO's tree, and names itself only where no instrument field is
known; a pixel listing a channel out of order or twice is refused; the
parity table says when a Bruker dense slab refuses (#185).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VkKZEUynSt6RczY9oKhrDU
@Paullo9 Paullo9 self-assigned this Nov 27, 2026
@Paullo9
Paullo9 enabled auto-merge (squash) November 27, 2026 18:09
@Paullo9
Paullo9 merged commit 2ddc61f into main Nov 27, 2026
12 checks passed
@Paullo9
Paullo9 deleted the claude/project-thread-b2qyav branch November 27, 2026 18:11
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.

fix: the EDS metadata tree is one FormatoHSPY can write, and the sparse store checks its channel order

2 participants