Skip to content

Fixes stale and missing documentation in ImzMLFile - #9745

Merged
timosachsenberg merged 1 commit into
OpenMS:developfrom
Aditya-Sarna:docs
Jul 15, 2026
Merged

timosachsenberg merged 1 commit into
OpenMS:developfrom
Aditya-Sarna:docs

Conversation

@Aditya-Sarna

@Aditya-Sarna Aditya-Sarna commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes stale and missing documentation in ImzMLFile to accurately reflect current implementation behaviour.

Changes

ImzMLFile class-level description

  • Corrected the "In-memory" loading mode bullet: geometry is derived from the parsed per-spectrum coordinate index, not from imzml:x/y MetaValues.
  • Added a new IBD integrity check section documenting that every load path verifies the first 16 bytes of the .ibd against the IMS:1000080 UUID in the .imzML XML, and that mismatches are advisory warnings (not hard errors) so legacy/non-conformant datasets still load.

load(filename, MSImagingExperiment&)

  • Rewrote method description to clearly state geometry comes from the parsed coordinate index (same path as loadSpectraIndex / OnDiscImzMLExperiment).
  • @throws Exception::InvalidValue narrowed to duplicate pixel coordinates only (out-of-grid and < 1 coordinates are warned and skipped, not thrown).

buildImagingGeometry(const MSExperiment&, MSImagingGeometry&)

  • Documented that out-of-grid and < 1 coordinates emit a warning and are skipped.
  • @throws Exception::InvalidValue narrowed to duplicate pixel coordinates only.
  • Added note recommending the index-based overload when a parsed index is available.

Scope

Documentation only — no functional code changes.

Files changed

  • src/openms/include/OpenMS/FORMAT/ImzMLFile.h

Summary by CodeRabbit

  • Documentation
    • Clarified how imzML loading constructs imaging geometry and handles random access.
    • Documented validation of the companion IBD file against the XML UUID, including warning behavior for mismatches or missing UUIDs.
    • Clarified handling of duplicate, invalid, and out-of-grid coordinates, including when entries are skipped or errors are raised.

Document that every load path (in-memory, streaming, index-only) performs
an advisory UUID header check between IMS:1000080 in the .imzML XML and the
first 16 bytes of the companion .ibd. Mismatches are reported as warnings
rather than hard errors so legacy / non-conformant datasets still load;
callers requiring strict conformance should inspect the warning log.

This behavior was implemented but not surfaced in the Doxygen class docs.
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

ImzMLFile documentation now reflects index-based imaging geometry construction, refined coordinate validation behavior, .ibd UUID integrity warnings, and expanded API descriptions without changing public declarations.

Changes

ImzML documentation

Layer / File(s) Summary
Loading and geometry behavior
src/openms/include/OpenMS/FORMAT/ImzMLFile.h
Documents geometry derived from per-spectrum coordinate indices, zero-based conversion, warning-based skipping of invalid coordinates, and Exception::InvalidValue for duplicates.
Integrity and API documentation
src/openms/include/OpenMS/FORMAT/ImzMLFile.h
Documents .ibd UUID checks and warning behavior, and expands constructor and option descriptions without changing signatures.

Poem

A rabbit hops through pixels bright,
Indexes guide the grid just right.
UUIDs whisper, “Check me, please,”
Warnings rustle in the trees.
Duplicate spots now raise a thump,
While tidy docs make readers jump.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the documentation-only ImzMLFile update and is concise.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/openms/include/OpenMS/FORMAT/ImzMLFile.h (1)

84-88: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Follow Rule-of-0 or Rule-of-6 for constructors and destructors.

As per coding guidelines, classes should follow the Rule-of-0 or Rule-of-6. Because a destructor is explicitly declared (~ImzMLFile() override = default;), the compiler suppresses the implicit generation of the move constructor and move assignment operator.

To restore move semantics and strictly comply with the Rule-of-6, explicitly = default (or = delete) the copy and move constructors and assignment operators. Alternatively, if the base class's virtual destructor is sufficient and no special cleanup is needed, you can remove the destructor declaration entirely to adhere to the Rule-of-0.

♻️ Proposed refactor (Rule-of-6)
     /// Default constructor
     ImzMLFile();
+    /// Copy constructor
+    ImzMLFile(const ImzMLFile&) = default;
+    /// Move constructor
+    ImzMLFile(ImzMLFile&&) = default;
+    /// Copy assignment
+    ImzMLFile& operator=(const ImzMLFile&) = default;
+    /// Move assignment
+    ImzMLFile& operator=(ImzMLFile&&) = default;
     /// Destructor
     ~ImzMLFile() override = default;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/openms/include/OpenMS/FORMAT/ImzMLFile.h` around lines 84 - 88, Update
the ImzMLFile special-member declarations around ImzMLFile() and ~ImzMLFile() to
follow the Rule-of-0 or Rule-of-6: either remove the redundant destructor if the
inherited virtual destructor is sufficient, or explicitly default/delete the
copy constructor, copy assignment, move constructor, and move assignment so the
intended ownership and move semantics are declared.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/openms/include/OpenMS/FORMAT/ImzMLFile.h`:
- Around line 84-88: Update the ImzMLFile special-member declarations around
ImzMLFile() and ~ImzMLFile() to follow the Rule-of-0 or Rule-of-6: either remove
the redundant destructor if the inherited virtual destructor is sufficient, or
explicitly default/delete the copy constructor, copy assignment, move
constructor, and move assignment so the intended ownership and move semantics
are declared.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a49bc7c-f685-4383-8926-8f0f2cd5f748

📥 Commits

Reviewing files that changed from the base of the PR and between fc4e829 and 19fee0d.

📒 Files selected for processing (1)
  • src/openms/include/OpenMS/FORMAT/ImzMLFile.h

@timosachsenberg
timosachsenberg merged commit 3cb753a into OpenMS:develop Jul 15, 2026
41 checks passed
timosachsenberg added a commit that referenced this pull request Jul 21, 2026
…erence (#9772)

- Add entry for #9745 (corrected stale ImzMLFile documentation on
  imaging geometry derivation, .ibd integrity check, and narrowed
  InvalidValue throw conditions).
- Point the Arrow APT signing-key self-heal entry at the actual merged
  PR #9750 instead of only the tracking issue #9729.


Claude-Session: https://claude.ai/code/session_01XoLJy9fP8E2m25rggnF6h3

Co-authored-by: Claude <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Aug 11, 2026
4 tasks done
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.

2 participants