pynwb.testing.icephys_testutils module

Module with helper functions to facilitate testing

pynwb.testing.icephys_testutils.create_icephys_stimulus_and_response(sweep_number, electrode, randomize_data)[source]

Internal helper function to construct a dummy stimulus and response pair representing an intracellular recording:

Parameters
  • sweep_number (int) – Integer sweep number of the recording

  • electrode (pynwb.icephys.IntracellularElectrode) – Intracellular electrode used

  • randomize_data (bool) – Randomize data values in the stimulus and response

Returns

Tuple of VoltageClampStimulusSeries with the stimulus and VoltageClampSeries with the response.

pynwb.testing.icephys_testutils.create_icephys_testfile(filename=None, add_custom_columns=True, randomize_data=True, with_missing_stimulus=True)[source]

Create a small but relatively complex icephys test file that we can use for testing of queries.

Parameters
  • filename (str, None) – The name of the output file to be generated. If set to None then the file is not written but only created in memory

  • add_custom_colums (bool) – Add custom metadata columns to each table

  • randomize_data (bool) – Randomize data values in the stimulus and response

Returns

ICEphysFile NWBFile object created for writing. NOTE: If filename is provided then the file is written to disk, but the function does not read the file back. If you want to use the file from disk then you will need to read it with NWBHDF5IO.

Return type

ICEphysFile