Metadata API

class nsds_lab_to_nwb.metadata.metadata_manager.LegacyMetadataReader(block_metadata_path: str, metadata_lib_path: str, block_folder: str, metadata_save_path=None)[source]

Bases: nsds_lab_to_nwb.metadata.metadata_manager.MetadataReader

Reads metadata input for old experiments.

complete_notes()[source]
extra_cleanup()[source]
load_metadata_source()[source]
parse()[source]
class nsds_lab_to_nwb.metadata.metadata_manager.MetadataManager(block_metadata_path: str, metadata_lib_path=None, stim_lib_path=None, block_folder=None, metadata_save_path=None, experiment_type='auditory', legacy_block=None)[source]

Bases: object

Manages metadata for NWB file builder

Parameters
  • block_metadata_path (str) – Path to block metadata file.

  • metadata_lib_path (str) – Path to metadata library repo.

  • stim_lib_path (str) – Path to stimulus library.

  • block_folder (str) – Block specification.

  • metadata_save_path (str (optional)) – Path to a directory where parsed metadata file(s) will be saved. Files are saved only if metadata_save_path is provided.

  • experiment_type (str (optional)) – Experiment type within the NSDS Lab: ‘auditory’ (default) or ‘behavior’.

  • legacy_block (bool (optional)) – Indicates whether this is a legacy block. If not provided, auto-detect by the animal naming scheme.

extract_metadata()[source]
class nsds_lab_to_nwb.metadata.metadata_manager.MetadataReader(block_metadata_path: str, metadata_lib_path: str, block_folder: str, metadata_save_path=None)[source]

Bases: object

Reads metadata input for new experiments.

common_check()[source]

make sure that core fields exist before further expanding metadata components. common for both new and legacy pipelines.

complete_notes()[source]
extra_cleanup()[source]
load_metadata_source()[source]
parse()[source]
read()[source]
class nsds_lab_to_nwb.metadata.exp_note_reader.ExpNoteReader(path, block_folder, input_format=None)[source]

Bases: object

Class for parsing experiment notes

Parameters
  • path (str) – Path or Google Sheets URL to the experiment notes

  • block_folder (str) – Name of the block to parse for

Raises

Exception – Raises exception when trying to parse xlsx or Google sheets because those parses are not implemented

dump_yaml(write_path=None)[source]

Dump yaml file

Parameters

write_path (str, optional) – Path to write yaml file, by default None If None writes to self.path

get_nsds_meta()[source]

Get parsed data

Returns

nsds_meta – Parsed meta data

Return type

dict

merge_meta_block()[source]

Merge meta and block dataframes and return as dictionary

parse_sheets()[source]

Parse raw dataframes read from experiment notes

read_csvs()[source]

Read csv files

read_gs()[source]

Read Google Sheet

Raises

NotImplementedError – ToDo

read_input()[source]

Read input

read_ods()[source]

Read ods

read_xlsx()[source]

Read xlsx