Sync metadata with the draft spec - #14
Conversation
📝 WalkthroughWalkthroughThe change introduces ChangesMetadata manager and schema refactor
Sequence Diagram(s)sequenceDiagram
participant Index
participant UtilManager
participant Archive
participant Parquet
Index->>UtilManager: find_file(name)
UtilManager->>Archive: access indexed file
UtilManager->>Parquet: open file
Parquet-->>Index: return reader
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
include/mzpeak/index.h (1)
11-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winInclude each standard-library declaration used by a public header.
The C++ standard does not guarantee the current transitive includes. Add direct includes so consumers can include each public header first.
include/mzpeak/index.h#L11-L12: add#include <string_view>forIndex::find.include/mzpeak/util/manager.h#L11-L15: add#include <string_view>and#include <vector>for the public manager declarations.Proposed fix
--- a/include/mzpeak/index.h +++ b/include/mzpeak/index.h `#include` <memory> +#include <string_view> `#include` <vector> --- a/include/mzpeak/util/manager.h +++ b/include/mzpeak/util/manager.h `#include` <memory> +#include <string_view> +#include <vector>Verify this with a compile-only public-header self-containment target on each supported compiler.
🤖 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 `@include/mzpeak/index.h` around lines 11 - 12, Make the public headers self-contained by adding <string_view> to include/mzpeak/index.h for Index::find, and adding <string_view> plus <vector> to include/mzpeak/util/manager.h for its public declarations. Verify both headers with a compile-only self-containment target on every supported compiler.
🤖 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.
Inline comments:
In `@src/metadata/table.cpp`:
- Around line 59-60: Update the exception message in the schema validation path
to include a space between the group name and “group,” so missing “root” reports
“root group” instead of “rootgroup.”
In `@src/schema/group.cpp`:
- Around line 154-192: Update the nested-list handling around the link lambda
and field_type_from_parquet so list leaf fields such as
scan_windows.scan_window_lower_limit and scan_windows.scan_window_upper_limit
are represented or have their CV metadata populated during parsing. Ensure each
nested leaf is matched against file.columns() using its full path, and add
coverage resolving both CV accessions.
- Around line 137-146: Update Parquet::Impl::parse_schema to advance the offset
by every preceding leaf column, including root-level primitive fields, before
constructing each nested Group via Group::Group and make_fields. Ensure nested
fields receive non-colliding absolute indexes, and add coverage for a schema
mixing a top-level primitive column before a nested struct.
In `@src/util/parquet.cpp`:
- Around line 69-77: Update the error-message construction in the open-failure
and reader-build-failure paths to use file_.file_name() instead of the
moved-from file.file_name(). Preserve the existing message format and
ParquetError behavior.
---
Nitpick comments:
In `@include/mzpeak/index.h`:
- Around line 11-12: Make the public headers self-contained by adding
<string_view> to include/mzpeak/index.h for Index::find, and adding
<string_view> plus <vector> to include/mzpeak/util/manager.h for its public
declarations. Verify both headers with a compile-only self-containment target on
every supported compiler.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 136f2e11-70a1-455b-8682-73fd365f6537
⛔ Files ignored due to path filters (9)
test/files/small.dir/chromatograms_data.parquetis excluded by!**/*.parquettest/files/small.dir/chromatograms_metadata.parquetis excluded by!**/*.parquettest/files/small.dir/chromatograms_metadata_precursors.parquetis excluded by!**/*.parquettest/files/small.dir/chromatograms_metadata_selected_ions.parquetis excluded by!**/*.parquettest/files/small.dir/spectra_data.parquetis excluded by!**/*.parquettest/files/small.dir/spectra_metadata.parquetis excluded by!**/*.parquettest/files/small.dir/spectra_metadata_precursors.parquetis excluded by!**/*.parquettest/files/small.dir/spectra_metadata_scans.parquetis excluded by!**/*.parquettest/files/small.dir/spectra_metadata_selected_ions.parquetis excluded by!**/*.parquet
📒 Files selected for processing (35)
bin/mzp-inspect.cppinclude/mzpeak/index.hinclude/mzpeak/metadata/spectrum.hinclude/mzpeak/schema/file.hinclude/mzpeak/schema/group.hinclude/mzpeak/spectra.hinclude/mzpeak/spectrum.hinclude/mzpeak/util/manager.hmeson.buildsrc/data/array_index.cppsrc/data/signals.cppsrc/index.cppsrc/metadata/spectrum.cppsrc/metadata/table.cppsrc/schema/file.cppsrc/schema/group.cppsrc/spectra.cppsrc/spectrum.cppsrc/util/executor.cppsrc/util/manager.cppsrc/util/parquet.cppsrc/util/query.cpptest/array_index_test.cpptest/executor_test.cpptest/files/Example_Processed.img.mzpeaktest/files/has_uv.mzpeaktest/files/small.chunked.mzpeaktest/files/small.dir/mzpeak_index.jsontest/files/small.mzpeaktest/files/small.numpress.mzpeaktest/group_test.cpptest/index_test.cpptest/parquet_test.cpptest/planner_test.cpptest/spectra_test.cpp
Since we need to load metadata Parquet files on demand we need a way to pass around an object that knows how to do that. I thought about doing it with the top-level `Index` class but that would create some circular dependencies and be a bit messy.
Also refactor the Schema::File struct to be a class.
The entry was removed but I never updated the allocation line.
037f75a to
6195f0a
Compare
Update the test files and code to match the current draft spec.
Summary by CodeRabbit