Add NotificationSummary class for structured, version-stamped inspection reports#353
Draft
Add NotificationSummary class for structured, version-stamped inspection reports#353
Conversation
- Add `NotificationSummary` class in `notifications/_notification_summary.py` with `__str__`, `to_json()`, and `to_file(path, aggregate=True)` methods - Export `NotificationSummary` from `notifications/__init__.py` and top-level `__init__.py` - Update `DatasetConverter.convert_to_bids_dataset()` to use `NotificationSummary` and write both `.json` and `.txt` report files - Update integration test to match new JSON structure (dict with version/run_id/notifications) - Add unit tests in `tests/unit/test_notification_summary.py` Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add report generation for inspections with NotificationSummary class
Add NotificationSummary class for structured, version-stamped inspection reports
Mar 19, 2026
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.
Notifications were written as a raw JSON array with no version-stamping, no human-readable format, and no aggregation of repeated notification types.
New:
NotificationSummaryIntroduced
nwb2bids.NotificationSummary— a lightweight wrapper around a list of notifications that produces structured, version-stamped reports.Key behaviors
__str__— aggregated byidentifier, with occurrence count and merged file paths per type; suitable for notebooks and IPythonto_json()— full, non-aggregated dump; wraps the notifications array in{"nwb2bids_version": ..., "run_id": ..., "notifications": [...]}to_file(path, aggregate=True)— format inferred from suffix (.jsonvs text); aggregated by default (one entry per notification type withcountfield and merged paths),aggregate=Falsewrites every individual notificationUpdated:
DatasetConverter.convert_to_bids_dataset()Now uses
NotificationSummaryand writes both the.txt(human-readable) and.json(structured) report files on every run. Previously only the JSON file was written and it lacked version metadata.Breaking change to
.jsonreport formatThe
{run_id}_notifications.jsonfile is now a JSON object rather than a bare array:{ "nwb2bids_version": "0.1.0", "run_id": "datetime-20240101120000", "notifications": [ { "identifier": "InvalidSpecies", "count": 2, "severity": "ERROR", ... } ] }Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.