-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flexible subject reading #73
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header method looks good, but I don't see where it's called or where self.subject
is set.
@@ -253,3 +261,10 @@ def determine_trial_times(self): | |||
end = None # determine final 'end' later from speed data | |||
trial_times.append((start, end)) | |||
return trial_times | |||
|
|||
def get_subject_info(self): | |||
return "\n".join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder whether ". ".join(...
is better (to have everything in a single line. It could get quite long if we have a lot of information though.
# If both metadata and header have a non-empty subject entry, the header gets priority. | ||
# If neither have an entry, pynwb defaults to not writing a subject field in the file. | ||
if self.subject: | ||
self.add_subject(self.subject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure that this way prioritises the header over the metadata? If they both have subject information, does the second call to add_subject
not do anything, or does it fail (or overwrite it with the second argument)?
This includes all non-empty information from the
[BIOLOGY INFORMATION]
section provided in headers of non-legacy LabView versions under theSubject
group in the NWB file. If any of these header fields are non-empty, they will be written as a row inSubject
, and any subject-related entries in the metadata will be ignored as a consequence.Addresses one of the remaining points in #23 .