Skip to content
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

Add keywords #620

Merged
merged 8 commits into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/pynwb/data/nwb.file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ groups:
dtype: text
doc: Institution(s) where experiment was performed
quantity: '?'
- name: keywords
dtype: text
doc: Terms to search over
quantity: '?'
shape:
- null
- name: lab
dtype: text
doc: Lab where experiment was performed
Expand Down
3 changes: 3 additions & 0 deletions src/pynwb/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class NWBFile(MultiContainerInterface):
'description',
'experiment_description',
'session_id',
'keywords',
'lab',
'institution',
'notes',
Expand Down Expand Up @@ -180,6 +181,7 @@ class NWBFile(MultiContainerInterface):
{'name': 'session_id', 'type': str, 'doc': 'lab-specific ID for the session', 'default': None},
{'name': 'institution', 'type': str,
'doc': 'institution(s) where experiment is performed', 'default': None},
{'name': 'keywords', 'type': 'array_data', 'doc': 'Terms to search over', 'default': None},
{'name': 'notes', 'type': str,
'doc': 'Notes about the experiment.', 'default': None},
{'name': 'pharmacology', 'type': str,
Expand Down Expand Up @@ -259,6 +261,7 @@ def __init__(self, **kwargs):
self.acquisition = getargs('acquisition', kwargs)
self.stimulus = getargs('stimulus', kwargs)
self.stimulus_template = getargs('stimulus_template', kwargs)
self.keywords = getargs('keywords', kwargs)

self.modules = getargs('modules', kwargs)
epochs = getargs('epochs', kwargs)
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/pynwb_tests/test_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def setUp(self):
source_script='noscript',
source_script_file_name='nofilename',
stimulus_notes='test stimulus notes',
data_collection='test data collection notes')
data_collection='test data collection notes',
keywords=('these', 'are', 'keywords'))

def test_constructor(self):
self.assertEqual(self.nwbfile.session_description, 'a test session description for a test NWBFile')
Expand All @@ -49,6 +50,7 @@ def test_constructor(self):
self.assertEqual(self.nwbfile.data_collection, 'test data collection notes')
self.assertEqual(self.nwbfile.source_script, 'noscript')
self.assertEqual(self.nwbfile.source_script_file_name, 'nofilename')
self.assertEqual(self.nwbfile.keywords, ('these', 'are', 'keywords'))

def test_create_electrode_group(self):
name = 'example_electrode_group'
Expand Down