Skip to content

IntracellularRecordingsTable stimulus/response require metadata even if the stimulus/response is missing #1384

@oruebel

Description

@oruebel

This issue was originally reported by @lvsltz in oruebel/ndx-icephys-meta#66. This issue has been copied here since it will need to be addressed in PyNWB.

The stimuli table (IntracellularStimuliTable) (and co.) requires stimulus_metadata to be passed even if the stimulus argument itself is None.
I understand why this is happening, but it doesn't seem like an expected behavior.

Example from README identical until line (A):

ir_table = nwbfile.get_intracellular_recordings()
ir_table.add_column('new_column', 'Stimulus special column', category='stimuli')
meta = {}
meta['new_column'] = 2
ir_index = nwbfile.add_intracellular_recording(electrode=electrode,
                                               stimulus=stimulus,
                                               response=response,
                                               stimulus_metadata = meta)

# All going fine until here
ir_index = nwbfile.add_intracellular_recording(electrode=electrode,
                                               response=response)

Error:

ValueError: row data keys don't match available columns
you supplied 0 extra keys: set()
and were missing 1 keys: {'new_column'}

Checklist

  • Have you ensured the feature or change was not already reported?
  • Have you included a brief and descriptive title?
  • Have you included a clear description of the problem you are trying to solve?
  • Have you included a minimal code snippet that reproduces the issue you are encountering?
  • Have you checked our Contributing document?

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: enhancementimprovements of code or code behaviorhelp wanted: deep diverequest for community contributions that will involve many parts of the code base

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions