Add datasetSummary and compareDatasetSummary utilities#44
Merged
Conversation
Extract dataset summary logic from symmetry tests into public ndi.util functions (mirroring MATLAB's ndi.util.datasetSummary and ndi.util.compareDatasetSummary). Simplify symmetry tests to use the new utilities instead of inline summary building and comparison. Add 14 unit tests covering both functions. https://claude.ai/code/session_01EctVW1VcbY2LzAdfZrGBB5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add two new utility functions for dataset-level symmetry testing:
datasetSummarycreates a summary structure of an NDI Dataset object, andcompareDatasetSummarycompares two dataset summaries and returns a report of differences.Key Changes
dataset_summary.py: ImplementsdatasetSummary()function that creates a summary dict containing numSessions, references, sessionIds, and sessionSummaries for an ndi.dataset.Dataset objectcompare_dataset_summary.py: ImplementscompareDatasetSummary()function that compares two dataset summaries and returns a list of human-readable difference strings, with support for excluding specific files and fieldsndi/util/__init__.py: Exports the newdatasetSummaryandcompareDatasetSummaryfunctionstest_dataset_summary.pywith 13 test cases covering empty datasets, single/multiple sessions, field validation, and comparison logic including session ID matchingtest_build_dataset.pyandtest_download_ingested.pyto use the new dataset-level utilities instead of manually iterating through sessions_dataset_summary()helper fromtest_build_dataset.pyin favor of the public utilityImplementation Details
compareDatasetSummarydelegates session-level comparisons to the existingcompareSessionSummaryfunctionexcludeFilesandexcludeFieldsparameters for flexible comparison scenarioshttps://claude.ai/code/session_01EctVW1VcbY2LzAdfZrGBB5