Update NwbFile.m : Generate uuid if no identifier is given for file#839
Open
ehennestad wants to merge 3 commits into
Open
Update NwbFile.m : Generate uuid if no identifier is given for file#839ehennestad wants to merge 3 commits into
ehennestad wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes NwbFile construction so that an identifier is automatically assigned when omitted, aligning MatNWB behavior with the NWBInspector “best practice” guidance for NWBFile.identifier.
Changes:
- Adds automatic UUID assignment to
identifierduringNwbFileconstruction. - Passes the generated
identifierthrough to the underlyingtypes.core.NWBFileconstructor via name/value pairs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: ehennestad <17237719+ehennestad@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #839 +/- ##
=======================================
Coverage 95.31% 95.31%
=======================================
Files 219 219
Lines 7647 7648 +1
=======================================
+ Hits 7289 7290 +1
Misses 358 358 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Motivation
nwbinspector docs states that MatNWB will add a uuid to the
NWBFilesidentifierproperty.This was actually not happening, but this PR fixes that. When creating an NWB file using
NwbFile, if noidentifieris given on construction, a uuid is assigned.How to test the behavior?
Creating an NwbFile object without an identifier:
Creating an NwbFile object with a custom identifier:
Checklist
fix #XXwhereXXis the issue number?