-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2372 from AllenInstitute/vbn_nwb_writer
Vbn nwb writer
- Loading branch information
Showing
15 changed files
with
388 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Empty file.
44 changes: 44 additions & 0 deletions
44
allensdk/brain_observatory/ecephys/write_nwb/vbn/__main__.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"""Module for writing NWB files for the Visual Behavior Neuropixels project""" | ||
|
||
import logging | ||
import sys | ||
import argschema | ||
import marshmallow | ||
from allensdk.brain_observatory.ecephys.behavior_ecephys_session import \ | ||
BehaviorEcephysSession | ||
from allensdk.brain_observatory.nwb.nwb_utils import NWBWriter | ||
from allensdk.brain_observatory.ecephys.write_nwb.vbn._schemas import \ | ||
VBNInputSchema, OutputSchema | ||
|
||
|
||
def main(): | ||
args = sys.argv[1:] | ||
try: | ||
parser = argschema.ArgSchemaParser( | ||
args=args, | ||
schema_type=VBNInputSchema, | ||
output_schema_type=OutputSchema, | ||
) | ||
logging.info('Input successfully parsed') | ||
except marshmallow.exceptions.ValidationError as err: | ||
logging.error('Parsing failure') | ||
logging.error(err) | ||
raise err | ||
|
||
nwb_writer = NWBWriter( | ||
nwb_filepath=parser.args['output_path'], | ||
session_data=parser.args['session_data'], | ||
serializer=BehaviorEcephysSession | ||
) | ||
|
||
try: | ||
nwb_writer.write_nwb(skip_probes=parser.args['skip_probes']) | ||
logging.info('File successfully created') | ||
except Exception as err: | ||
logging.error('NWB write failure') | ||
logging.error(err) | ||
raise err | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.